2 * Copyright (C) 2010 ZXing authors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * These authors would like to acknowledge the Spanish Ministry of Industry,
19 * Tourism and Trade, for the support in the project TSI020301-2008-2
20 * "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled
21 * Mobile Dynamic Environments", led by Treelogic
22 * ( http://www.treelogic.com/ ):
24 * http://www.piramidepse.com/
27 package com.google.zxing.oned.rss.expanded.decoders;
29 import org.junit.Test;
32 * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
34 public class AI01_3X0X_1X_DecoderTest extends AbstractDecoderTest {
36 private static final String header_310x_11 = "..XXX...";
37 private static final String header_320x_11 = "..XXX..X";
38 private static final String header_310x_13 = "..XXX.X.";
39 private static final String header_320x_13 = "..XXX.XX";
40 private static final String header_310x_15 = "..XXXX..";
41 private static final String header_320x_15 = "..XXXX.X";
42 private static final String header_310x_17 = "..XXXXX.";
43 private static final String header_320x_17 = "..XXXXXX";
46 public void test01_310X_1X_endDate() throws Exception {
47 String data = header_310x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_End;
48 String expected = "(01)90012345678908(3100)001750";
50 assertCorrectBinaryString(data, expected);
54 public void test01_310X_11_1() throws Exception {
55 String data = header_310x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
56 String expected = "(01)90012345678908(3100)001750(11)100312";
58 assertCorrectBinaryString(data, expected);
62 public void test01_320X_11_1() throws Exception {
63 String data = header_320x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
64 String expected = "(01)90012345678908(3200)001750(11)100312";
66 assertCorrectBinaryString(data, expected);
70 public void test01_310X_13_1() throws Exception {
71 String data = header_310x_13 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
72 String expected = "(01)90012345678908(3100)001750(13)100312";
74 assertCorrectBinaryString(data, expected);
78 public void test01_320X_13_1() throws Exception {
79 String data = header_320x_13 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
80 String expected = "(01)90012345678908(3200)001750(13)100312";
82 assertCorrectBinaryString(data, expected);
86 public void test01_310X_15_1() throws Exception {
87 String data = header_310x_15 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
88 String expected = "(01)90012345678908(3100)001750(15)100312";
90 assertCorrectBinaryString(data, expected);
94 public void test01_320X_15_1() throws Exception {
95 String data = header_320x_15 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
96 String expected = "(01)90012345678908(3200)001750(15)100312";
98 assertCorrectBinaryString(data, expected);
102 public void test01_310X_17_1() throws Exception {
103 String data = header_310x_17 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
104 String expected = "(01)90012345678908(3100)001750(17)100312";
106 assertCorrectBinaryString(data, expected);
110 public void test01_320X_17_1() throws Exception {
111 String data = header_320x_17 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
112 String expected = "(01)90012345678908(3200)001750(17)100312";
114 assertCorrectBinaryString(data, expected);