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;
30 * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
32 public class AI01_3X0X_1X_DecoderTest extends AbstractDecoderTest {
34 private static final String header_310x_11 = "..XXX...";
35 private static final String header_320x_11 = "..XXX..X";
36 private static final String header_310x_13 = "..XXX.X.";
37 private static final String header_320x_13 = "..XXX.XX";
38 private static final String header_310x_15 = "..XXXX..";
39 private static final String header_320x_15 = "..XXXX.X";
40 private static final String header_310x_17 = "..XXXXX.";
41 private static final String header_320x_17 = "..XXXXXX";
43 public void test01_310X_1X_endDate() throws Exception {
44 String data = header_310x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_End;
45 String expected = "(01)90012345678908(3100)001750";
47 assertCorrectBinaryString(data, expected);
50 public void test01_310X_11_1() throws Exception {
51 String data = header_310x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
52 String expected = "(01)90012345678908(3100)001750(11)100312";
54 assertCorrectBinaryString(data, expected);
57 public void test01_320X_11_1() throws Exception {
58 String data = header_320x_11 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
59 String expected = "(01)90012345678908(3200)001750(11)100312";
61 assertCorrectBinaryString(data, expected);
64 public void test01_310X_13_1() throws Exception {
65 String data = header_310x_13 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
66 String expected = "(01)90012345678908(3100)001750(13)100312";
68 assertCorrectBinaryString(data, expected);
71 public void test01_320X_13_1() throws Exception {
72 String data = header_320x_13 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
73 String expected = "(01)90012345678908(3200)001750(13)100312";
75 assertCorrectBinaryString(data, expected);
78 public void test01_310X_15_1() throws Exception {
79 String data = header_310x_15 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
80 String expected = "(01)90012345678908(3100)001750(15)100312";
82 assertCorrectBinaryString(data, expected);
85 public void test01_320X_15_1() throws Exception {
86 String data = header_320x_15 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
87 String expected = "(01)90012345678908(3200)001750(15)100312";
89 assertCorrectBinaryString(data, expected);
92 public void test01_310X_17_1() throws Exception {
93 String data = header_310x_17 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
94 String expected = "(01)90012345678908(3100)001750(17)100312";
96 assertCorrectBinaryString(data, expected);
99 public void test01_320X_17_1() throws Exception {
100 String data = header_320x_17 + compressedGtin_900123456798908 + compressed20bitWeight_1750 + compressedDate_March_12th_2010;
101 String expected = "(01)90012345678908(3200)001750(17)100312";
103 assertCorrectBinaryString(data, expected);