You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/04/09 19:31:45 UTC
svn commit: r1466146 [20/20] - in /xmlgraphics/fop/trunk: ./
src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/
src/codegen/unicode/java/org/apache/fop/text/linebreak/
src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/ src/java/o...
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFileTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFileTestCase.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFileTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/ttx/TTXFileTestCase.java Tue Apr 9 17:31:41 2013
@@ -39,12 +39,12 @@ public class TTXFileTestCase {
@Test
public void testTTXFiles() throws Exception {
- for ( String tfn : ttxFiles ) {
+ for (String tfn : ttxFiles) {
try {
- TTXFile tf = TTXFile.getFromCache ( ttxFilesRoot + File.separator + tfn );
- assertTrue ( tf != null );
- } catch ( Exception e ) {
- fail ( e.getMessage() );
+ TTXFile tf = TTXFile.getFromCache (ttxFilesRoot + File.separator + tfn);
+ assertTrue (tf != null);
+ } catch (Exception e) {
+ fail (e.getMessage());
}
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestCase.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/ArabicTestCase.java Tue Apr 9 17:31:41 2013
@@ -52,68 +52,68 @@ public class ArabicTestCase implements A
@Test
public void testArabicWordForms() {
- for ( String sfn : srcFiles ) {
+ for (String sfn : srcFiles) {
try {
- processWordForms ( new File ( datFilesDir ) );
- } catch ( Exception e ) {
- fail ( e.getMessage() );
+ processWordForms (new File (datFilesDir));
+ } catch (Exception e) {
+ fail (e.getMessage());
}
}
}
- private void processWordForms ( File dfd ) {
- String[] files = listWordFormFiles ( dfd );
- for ( String fn : files ) {
- File dff = new File ( dfd, fn );
- processWordForms ( dff.getAbsolutePath() );
+ private void processWordForms (File dfd) {
+ String[] files = listWordFormFiles (dfd);
+ for (String fn : files) {
+ File dff = new File (dfd, fn);
+ processWordForms (dff.getAbsolutePath());
}
}
- private String[] listWordFormFiles ( File dfd ) {
- return dfd.list ( new FilenameFilter() {
- public boolean accept ( File f, String name ) {
- return hasPrefixFrom ( name, srcFiles ) && hasExtension ( name, WF_FILE_DAT_EXT );
+ private String[] listWordFormFiles (File dfd) {
+ return dfd.list (new FilenameFilter() {
+ public boolean accept (File f, String name) {
+ return hasPrefixFrom (name, srcFiles) && hasExtension (name, WF_FILE_DAT_EXT);
}
- private boolean hasPrefixFrom ( String name, String[] prefixes ) {
- for ( String p : prefixes ) {
- if ( name.startsWith ( p ) ) {
+ private boolean hasPrefixFrom (String name, String[] prefixes) {
+ for (String p : prefixes) {
+ if (name.startsWith (p)) {
return true;
}
}
return false;
}
- private boolean hasExtension ( String name, String extension ) {
- return name.endsWith ( "." + extension );
+ private boolean hasExtension (String name, String extension) {
+ return name.endsWith ("." + extension);
}
- } );
+ });
}
- private void processWordForms ( String dpn ) {
+ private void processWordForms (String dpn) {
FileInputStream fis = null;
try {
- fis = new FileInputStream ( dpn );
- if ( fis != null ) {
- ObjectInputStream ois = new ObjectInputStream ( fis );
+ fis = new FileInputStream (dpn);
+ if (fis != null) {
+ ObjectInputStream ois = new ObjectInputStream (fis);
List<Object[]> data = (List<Object[]>) ois.readObject();
- if ( data != null ) {
- processWordForms ( data );
+ if (data != null) {
+ processWordForms (data);
}
ois.close();
}
- } catch ( FileNotFoundException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( IOException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( Exception e ) {
- throw new RuntimeException ( e.getMessage(), e );
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (IOException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (Exception e) {
+ throw new RuntimeException (e.getMessage(), e);
} finally {
- if ( fis != null ) {
- try { fis.close(); } catch ( Exception e ) {}
+ if (fis != null) {
+ try { fis.close(); } catch (Exception e) {}
}
}
}
- private void processWordForms ( List<Object[]> data ) {
+ private void processWordForms (List<Object[]> data) {
assert data != null;
assert data.size() > 0;
String script = null;
@@ -123,20 +123,20 @@ public class ArabicTestCase implements A
GlyphSubstitutionTable gsub = null;
GlyphPositioningTable gpos = null;
int[] widths = null;
- for ( Object[] d : data ) {
- if ( script == null ) {
+ for (Object[] d : data) {
+ if (script == null) {
assert d.length >= 4;
script = (String) d[0];
language = (String) d[1];
tfn = (String) d[3];
- tf = TTXFile.getFromCache ( ttxFontsDir + File.separator + tfn );
- assertTrue ( tf != null );
+ tf = TTXFile.getFromCache (ttxFontsDir + File.separator + tfn);
+ assertTrue (tf != null);
gsub = tf.getGSUB();
- assertTrue ( gsub != null );
+ assertTrue (gsub != null);
gpos = tf.getGPOS();
- assertTrue ( gpos != null );
+ assertTrue (gpos != null);
widths = tf.getWidths();
- assertTrue ( widths != null );
+ assertTrue (widths != null);
} else {
assert tf != null;
assert gsub != null;
@@ -147,48 +147,48 @@ public class ArabicTestCase implements A
int[] iga = (int[]) d[1];
int[] oga = (int[]) d[2];
int[][] paa = (int[][]) d[3];
- GlyphSequence tigs = tf.mapCharsToGlyphs ( wf );
- assertSameGlyphs ( iga, getGlyphs ( tigs ), "input glyphs", wf, tfn );
- GlyphSequence togs = gsub.substitute ( tigs, script, language );
- assertSameGlyphs ( oga, getGlyphs ( togs ), "output glyphs", wf, tfn );
+ GlyphSequence tigs = tf.mapCharsToGlyphs (wf);
+ assertSameGlyphs (iga, getGlyphs (tigs), "input glyphs", wf, tfn);
+ GlyphSequence togs = gsub.substitute (tigs, script, language);
+ assertSameGlyphs (oga, getGlyphs (togs), "output glyphs", wf, tfn);
int[][] tpaa = new int [ togs.getGlyphCount() ] [ 4 ];
- if ( gpos.position ( togs, script, language, 1000, widths, tpaa ) ) {
- assertSameAdjustments ( paa, tpaa, wf, tfn );
- } else if ( paa != null ) {
- assertEquals ( "unequal adjustment count, word form(" + wf + "), font (" + tfn + ")", paa.length, 0 );
+ if (gpos.position (togs, script, language, 1000, widths, tpaa)) {
+ assertSameAdjustments (paa, tpaa, wf, tfn);
+ } else if (paa != null) {
+ assertEquals ("unequal adjustment count, word form(" + wf + "), font (" + tfn + ")", paa.length, 0);
}
}
}
}
- private void assertSameGlyphs ( int[] expected, int[] actual, String label, String wf, String tfn ) {
- assertEquals ( label + ": unequal glyph count, word form(" + wf + "), font (" + tfn + ")", expected.length, actual.length );
- for ( int i = 0, n = expected.length; i < n; i++ ) {
+ private void assertSameGlyphs (int[] expected, int[] actual, String label, String wf, String tfn) {
+ assertEquals (label + ": unequal glyph count, word form(" + wf + "), font (" + tfn + ")", expected.length, actual.length);
+ for (int i = 0, n = expected.length; i < n; i++) {
int e = expected[i];
int a = actual[i];
- assertEquals ( label + ": unequal glyphs[" + i + "], word form(" + wf + "), font (" + tfn + ")", e, a );
+ assertEquals (label + ": unequal glyphs[" + i + "], word form(" + wf + "), font (" + tfn + ")", e, a);
}
}
- private void assertSameAdjustments ( int[][] expected, int[][] actual, String wf, String tfn ) {
- assertEquals ( "unequal adjustment count, word form(" + wf + "), font (" + tfn + ")", expected.length, actual.length );
- for ( int i = 0, n = expected.length; i < n; i++ ) {
+ private void assertSameAdjustments (int[][] expected, int[][] actual, String wf, String tfn) {
+ assertEquals ("unequal adjustment count, word form(" + wf + "), font (" + tfn + ")", expected.length, actual.length);
+ for (int i = 0, n = expected.length; i < n; i++) {
int[] ea = expected[i];
int[] aa = actual[i];
- assertEquals ( "bad adjustments length, word form(" + wf + "), font (" + tfn + ")", ea.length, aa.length );
- for ( int k = 0; k < 4; k++ ) {
+ assertEquals ("bad adjustments length, word form(" + wf + "), font (" + tfn + ")", ea.length, aa.length);
+ for (int k = 0; k < 4; k++) {
int e = ea[k];
int a = aa[k];
- assertEquals ( "unequal adjustment[" + i + "][" + k + "], word form(" + wf + "), font (" + tfn + ")", e, a );
+ assertEquals ("unequal adjustment[" + i + "][" + k + "], word form(" + wf + "), font (" + tfn + ")", e, a);
}
}
}
- private static int[] getGlyphs ( GlyphSequence gs ) {
+ private static int[] getGlyphs (GlyphSequence gs) {
IntBuffer gb = gs.getGlyphs();
int[] ga = new int [ gb.limit() ];
gb.rewind();
- gb.get ( ga );
+ gb.get (ga);
return ga;
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/GenerateArabicTestData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/GenerateArabicTestData.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/GenerateArabicTestData.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/scripts/arabic/GenerateArabicTestData.java Tue Apr 9 17:31:41 2013
@@ -42,136 +42,136 @@ import org.apache.fop.complexscripts.uti
*/
public class GenerateArabicTestData implements ArabicTestConstants {
- public static void main ( String[] args ) {
+ public static void main (String[] args) {
boolean compile = false;
boolean help = false;
- for ( String a : args ) {
- if ( a.equals("-c") ) {
+ for (String a : args) {
+ if (a.equals("-c")) {
compile = true;
}
- if ( a.equals("-?") ) {
+ if (a.equals("-?")) {
help = true;
}
}
- if ( help ) {
+ if (help) {
help();
- } else if ( compile ) {
+ } else if (compile) {
compile();
}
}
private static void help() {
StringBuffer sb = new StringBuffer();
- sb.append ( "org.apache.fop.complexscripts.arabic.ArabicTestCase" );
- sb.append ( " [-compile]" );
- sb.append ( " [-?]" );
- System.out.println ( sb.toString() );
+ sb.append ("org.apache.fop.complexscripts.arabic.ArabicTestCase");
+ sb.append (" [-compile]");
+ sb.append (" [-?]");
+ System.out.println (sb.toString());
}
private static void compile() {
- for ( String sfn : srcFiles ) {
+ for (String sfn : srcFiles) {
try {
String spn = srcFilesDir + File.separator + sfn + "." + WF_FILE_SRC_EXT;
- compile ( WF_FILE_SCRIPT, WF_FILE_LANGUAGE, spn );
- } catch ( Exception e ) {
- System.err.println ( e.getMessage() );
+ compile (WF_FILE_SCRIPT, WF_FILE_LANGUAGE, spn);
+ } catch (Exception e) {
+ System.err.println (e.getMessage());
}
}
}
- private static void compile ( String script, String language, String spn ) {
+ private static void compile (String script, String language, String spn) {
int fno = 0;
- for ( String tfn : ttxFonts ) {
- TTXFile tf = TTXFile.getFromCache ( ttxFontsDir + File.separator + tfn );
+ for (String tfn : ttxFonts) {
+ TTXFile tf = TTXFile.getFromCache (ttxFontsDir + File.separator + tfn);
assert tf != null;
- List data = compile ( script, language, spn, tfn, tf );
- output ( makeDataPathName ( spn, fno++ ), data );
+ List data = compile (script, language, spn, tfn, tf);
+ output (makeDataPathName (spn, fno++), data);
}
}
- private static List compile ( String script, String language, String spn, String tfn, TTXFile tf ) {
+ private static List compile (String script, String language, String spn, String tfn, TTXFile tf) {
List<Object[]> data = new ArrayList<Object[]>();
- data.add ( new Object[] { script, language, spn, tfn } );
+ data.add (new Object[] { script, language, spn, tfn });
GlyphSubstitutionTable gsub = tf.getGSUB();
GlyphPositioningTable gpos = tf.getGPOS();
int[] widths = tf.getWidths();
- if ( ( gsub != null ) && ( gpos != null ) ) {
+ if ((gsub != null) && (gpos != null)) {
FileInputStream fis = null;
try {
- fis = new FileInputStream ( spn );
- if ( fis != null ) {
- LineNumberReader lr = new LineNumberReader ( new InputStreamReader ( fis, Charset.forName ( "UTF-8" ) ) );
+ fis = new FileInputStream (spn);
+ if (fis != null) {
+ LineNumberReader lr = new LineNumberReader (new InputStreamReader (fis, Charset.forName ("UTF-8")));
String wf;
- while ( ( wf = lr.readLine() ) != null ) {
- GlyphSequence igs = tf.mapCharsToGlyphs ( wf );
- GlyphSequence ogs = gsub.substitute ( igs, script, language );
+ while ((wf = lr.readLine()) != null) {
+ GlyphSequence igs = tf.mapCharsToGlyphs (wf);
+ GlyphSequence ogs = gsub.substitute (igs, script, language);
int[][] paa = new int [ ogs.getGlyphCount() ] [ 4 ];
- if ( ! gpos.position ( ogs, script, language, 1000, widths, paa ) ) {
+ if (! gpos.position (ogs, script, language, 1000, widths, paa)) {
paa = null;
}
- data.add ( new Object[] { wf, getGlyphs ( igs ), getGlyphs ( ogs ), paa } );
+ data.add (new Object[] { wf, getGlyphs (igs), getGlyphs (ogs), paa });
}
lr.close();
}
- } catch ( FileNotFoundException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( IOException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( Exception e ) {
- throw new RuntimeException ( e.getMessage(), e );
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (IOException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (Exception e) {
+ throw new RuntimeException (e.getMessage(), e);
} finally {
- if ( fis != null ) {
- try { fis.close(); } catch ( Exception e ) {}
+ if (fis != null) {
+ try { fis.close(); } catch (Exception e) {}
}
}
} else {
assert gsub != null;
assert gpos != null;
}
- System.err.println ( "compiled " + ( data.size() - 1 ) + " word forms using font " + tfn );
+ System.err.println ("compiled " + (data.size() - 1) + " word forms using font " + tfn);
return data;
}
- private static int[] getGlyphs ( GlyphSequence gs ) {
+ private static int[] getGlyphs (GlyphSequence gs) {
IntBuffer gb = gs.getGlyphs();
int[] ga = new int [ gb.limit() ];
gb.rewind();
- gb.get ( ga );
+ gb.get (ga);
return ga;
}
- private static String makeDataPathName ( String spn, int fno ) {
- File f = new File ( spn );
- return datFilesDir + File.separator + stripExtension ( f.getName() ) + "-f" + fno + "." + WF_FILE_DAT_EXT;
+ private static String makeDataPathName (String spn, int fno) {
+ File f = new File (spn);
+ return datFilesDir + File.separator + stripExtension (f.getName()) + "-f" + fno + "." + WF_FILE_DAT_EXT;
}
- private static String stripExtension ( String s ) {
- int i = s.lastIndexOf ( '.' );
- if ( i >= 0 ) {
- return s.substring ( 0, i );
+ private static String stripExtension (String s) {
+ int i = s.lastIndexOf ('.');
+ if (i >= 0) {
+ return s.substring (0, i);
} else {
return s;
}
}
- private static void output ( String dpn, List<Object[]> data ) {
+ private static void output (String dpn, List<Object[]> data) {
FileOutputStream fos = null;
try {
- fos = new FileOutputStream ( dpn );
- if ( fos != null ) {
- ObjectOutputStream oos = new ObjectOutputStream ( fos );
- oos.writeObject ( data );
+ fos = new FileOutputStream (dpn);
+ if (fos != null) {
+ ObjectOutputStream oos = new ObjectOutputStream (fos);
+ oos.writeObject (data);
oos.close();
}
- } catch ( FileNotFoundException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( IOException e ) {
- throw new RuntimeException ( e.getMessage(), e );
- } catch ( Exception e ) {
- throw new RuntimeException ( e.getMessage(), e );
+ } catch (FileNotFoundException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (IOException e) {
+ throw new RuntimeException (e.getMessage(), e);
+ } catch (Exception e) {
+ throw new RuntimeException (e.getMessage(), e);
} finally {
- if ( fos != null ) {
- try { fos.close(); } catch ( Exception e ) {}
+ if (fos != null) {
+ try { fos.close(); } catch (Exception e) {}
}
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/util/NumberConverterTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/util/NumberConverterTestCase.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/util/NumberConverterTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/util/NumberConverterTestCase.java Tue Apr 9 17:31:41 2013
@@ -1329,10 +1329,10 @@ public class NumberConverterTestCase {
*/
@Test
public void testFormatDecimal() throws Exception {
- performConversions ( formatDecimal );
- performConversions ( formatDecimalPadded );
- performConversions ( formatDecimalGrouped );
- performConversions ( formatDecimalGroupedPadded );
+ performConversions (formatDecimal);
+ performConversions (formatDecimalPadded);
+ performConversions (formatDecimalGrouped);
+ performConversions (formatDecimalGroupedPadded);
}
/**
@@ -1341,10 +1341,10 @@ public class NumberConverterTestCase {
*/
@Test
public void testFormatDecimalArabic() throws Exception {
- performConversions ( formatDecimalArabic );
- performConversions ( formatDecimalArabicPadded );
- performConversions ( formatDecimalArabicGrouped );
- performConversions ( formatDecimalArabicGroupedPadded );
+ performConversions (formatDecimalArabic);
+ performConversions (formatDecimalArabicPadded);
+ performConversions (formatDecimalArabicGrouped);
+ performConversions (formatDecimalArabicGroupedPadded);
}
/**
@@ -1353,8 +1353,8 @@ public class NumberConverterTestCase {
*/
@Test
public void testFormatDecimalThai() throws Exception {
- performConversions ( formatDecimalThai );
- performConversions ( formatDecimalThaiPadded );
+ performConversions (formatDecimalThai);
+ performConversions (formatDecimalThaiPadded);
}
/**
@@ -1363,12 +1363,12 @@ public class NumberConverterTestCase {
*/
@Test
public void testFormatRoman() throws Exception {
- performConversions ( formatRomanLower );
- performConversions ( formatRomanUpper );
- performConversions ( formatRomanLargeLower );
- performConversions ( formatRomanLargeUpper );
- performConversions ( formatRomanNumberFormsLower );
- performConversions ( formatRomanNumberFormsUpper );
+ performConversions (formatRomanLower);
+ performConversions (formatRomanUpper);
+ performConversions (formatRomanLargeLower);
+ performConversions (formatRomanLargeUpper);
+ performConversions (formatRomanNumberFormsLower);
+ performConversions (formatRomanNumberFormsUpper);
}
/**
@@ -1377,8 +1377,8 @@ public class NumberConverterTestCase {
*/
@Test
public void testAlphabeticLatin() throws Exception {
- performConversions ( formatAlphabeticLatinLower );
- performConversions ( formatAlphabeticLatinUpper );
+ performConversions (formatAlphabeticLatinLower);
+ performConversions (formatAlphabeticLatinUpper);
}
/**
@@ -1387,8 +1387,8 @@ public class NumberConverterTestCase {
*/
@Test
public void testAlphabeticArabic() throws Exception {
- performConversions ( formatAlphabeticArabicHijai );
- performConversions ( formatAlphabeticArabicAbjadi );
+ performConversions (formatAlphabeticArabicHijai);
+ performConversions (formatAlphabeticArabicAbjadi);
}
/**
@@ -1397,7 +1397,7 @@ public class NumberConverterTestCase {
*/
@Test
public void testAlphabeticHebrew() throws Exception {
- performConversions ( formatAlphabeticHebrew );
+ performConversions (formatAlphabeticHebrew);
}
/**
@@ -1406,7 +1406,7 @@ public class NumberConverterTestCase {
*/
@Test
public void testAlphabeticThai() throws Exception {
- performConversions ( formatAlphabeticThai );
+ performConversions (formatAlphabeticThai);
}
/**
@@ -1415,7 +1415,7 @@ public class NumberConverterTestCase {
*/
@Test
public void testNumeralArabic() throws Exception {
- performConversions ( formatNumeralArabicAbjadi );
+ performConversions (formatNumeralArabicAbjadi);
}
/**
@@ -1424,7 +1424,7 @@ public class NumberConverterTestCase {
*/
@Test
public void testNumeralHebrew() throws Exception {
- performConversions ( formatNumeralHebrewGematria );
+ performConversions (formatNumeralHebrewGematria);
}
/**
@@ -1433,9 +1433,9 @@ public class NumberConverterTestCase {
*/
@Test
public void testWordEnglish() throws Exception {
- performConversions ( formatWordEnglishLower );
- performConversions ( formatWordEnglishUpper );
- performConversions ( formatWordEnglishTitle );
+ performConversions (formatWordEnglishLower);
+ performConversions (formatWordEnglishUpper);
+ performConversions (formatWordEnglishTitle);
}
/**
@@ -1444,9 +1444,9 @@ public class NumberConverterTestCase {
*/
@Test
public void testWordSpanish() throws Exception {
- performConversions ( formatWordSpanishLower );
- performConversions ( formatWordSpanishUpper );
- performConversions ( formatWordSpanishTitle );
+ performConversions (formatWordSpanishLower);
+ performConversions (formatWordSpanishUpper);
+ performConversions (formatWordSpanishTitle);
}
/**
@@ -1455,16 +1455,16 @@ public class NumberConverterTestCase {
*/
@Test
public void testWordFrench() throws Exception {
- performConversions ( formatWordFrenchLower );
- performConversions ( formatWordFrenchUpper );
- performConversions ( formatWordFrenchTitle );
+ performConversions (formatWordFrenchLower);
+ performConversions (formatWordFrenchUpper);
+ performConversions (formatWordFrenchTitle);
}
/**
* Perform conversions according to test specification.
* @param ts test specification
*/
- private void performConversions ( String[][] ts ) {
+ private void performConversions (String[][] ts) {
assert ts != null;
assert ts.length >= 2;
String[] args = ts[0];
@@ -1473,9 +1473,9 @@ public class NumberConverterTestCase {
String format = args[0];
assert format.length() > 0;
char groupingSeparator;
- if ( args.length > 1 ) {
+ if (args.length > 1) {
String s = args[1];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
+ if ((s != null) && (s.length() > 0)) {
groupingSeparator = s.charAt(0);
} else {
groupingSeparator = 0;
@@ -1484,10 +1484,10 @@ public class NumberConverterTestCase {
groupingSeparator = 0;
}
int groupingSize;
- if ( args.length > 2 ) {
+ if (args.length > 2) {
String s = args[2];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
- groupingSize = Integer.parseInt ( s );
+ if ((s != null) && (s.length() > 0)) {
+ groupingSize = Integer.parseInt (s);
} else {
groupingSize = 0;
}
@@ -1495,13 +1495,13 @@ public class NumberConverterTestCase {
groupingSize = 0;
}
int letterValue;
- if ( args.length > 3 ) {
+ if (args.length > 3) {
String s = args[3];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
+ if ((s != null) && (s.length() > 0)) {
s = s.toLowerCase();
- if ( s.equals("alphabetic") ) {
+ if (s.equals("alphabetic")) {
letterValue = NumberConverter.LETTER_VALUE_ALPHABETIC;
- } else if ( s.equals("traditional") ) {
+ } else if (s.equals("traditional")) {
letterValue = NumberConverter.LETTER_VALUE_TRADITIONAL;
} else {
letterValue = 0;
@@ -1513,9 +1513,9 @@ public class NumberConverterTestCase {
letterValue = 0;
}
String features;
- if ( args.length > 4 ) {
+ if (args.length > 4) {
String s = args[4];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
+ if ((s != null) && (s.length() > 0)) {
features = s;
} else {
features = null;
@@ -1524,9 +1524,9 @@ public class NumberConverterTestCase {
features = null;
}
String language;
- if ( args.length > 5 ) {
+ if (args.length > 5) {
String s = args[5];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
+ if ((s != null) && (s.length() > 0)) {
language = s;
} else {
language = null;
@@ -1535,9 +1535,9 @@ public class NumberConverterTestCase {
language = null;
}
String country;
- if ( args.length > 6 ) {
+ if (args.length > 6) {
String s = args[6];
- if ( ( s != null ) && ( s.length() > 0 ) ) {
+ if ((s != null) && (s.length() > 0)) {
country = s;
} else {
country = null;
@@ -1545,19 +1545,19 @@ public class NumberConverterTestCase {
} else {
country = null;
}
- NumberConverter nc = new NumberConverter ( format, groupingSeparator, groupingSize, letterValue, features, language, country );
- for ( int i = 1, nt = ts.length; i < nt; i++ ) {
+ NumberConverter nc = new NumberConverter (format, groupingSeparator, groupingSize, letterValue, features, language, country);
+ for (int i = 1, nt = ts.length; i < nt; i++) {
String[] sa = ts[i];
assert sa != null;
assert sa.length >= 2;
List<Long> numbers = new ArrayList<Long>();
- for ( int k = 0, nn = sa.length - 1; k < nn; k++ ) {
+ for (int k = 0, nn = sa.length - 1; k < nn; k++) {
String s = sa[k];
- numbers.add ( Long.valueOf ( s ) );
+ numbers.add (Long.valueOf (s));
}
String expected = sa [ sa.length - 1 ];
- String actual = nc.convert ( numbers );
- assertEquals ( expected, actual );
+ String actual = nc.convert (numbers);
+ assertEquals (expected, actual);
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java?rev=1466146&r1=1466145&r2=1466146&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/image/loader/batik/ImageLoaderTestCase.java Tue Apr 9 17:31:41 2013
@@ -216,7 +216,7 @@ public class ImageLoaderTestCase {
assertEquals(400000, info.getSize().getHeightMpt());
Raster raster = renImg.getData();
// This pixel is white
- int[] pixel1 = raster.getPixel(1, 1, (int[] )null);
+ int[] pixel1 = raster.getPixel(1, 1, (int[])null);
// This pixel is from the embedded JPG and is not white
int[] pixel80 = raster.getPixel(80, 80, (int[]) null);
assertEquals(pixel1.length, pixel80.length);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org