Big RSS Expanded changelist -- thank you authors
[zxing.git] / core / test / src / com / google / zxing / oned / rss / expanded / decoders / AI01_3X0X_1X_DecoderTest.java
1 /*
2  * Copyright (C) 2010 ZXing authors
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /*
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/ ):
23  *
24  *   http://www.piramidepse.com/
25  */
26
27 package com.google.zxing.oned.rss.expanded.decoders;
28
29 /**
30  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
31  */
32 public class AI01_3X0X_1X_DecoderTest extends AbstractDecoderTest {
33         
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";
42         
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";
46                 
47                 assertCorrectBinaryString(data, expected);
48         }
49         
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";
53                 
54                 assertCorrectBinaryString(data, expected);
55         }
56         
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";
60                 
61                 assertCorrectBinaryString(data, expected);
62         }
63         
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";
67                 
68                 assertCorrectBinaryString(data, expected);
69         }
70         
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";
74                 
75                 assertCorrectBinaryString(data, expected);
76         }
77         
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";
81                 
82                 assertCorrectBinaryString(data, expected);
83         }
84         
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";
88                 
89                 assertCorrectBinaryString(data, expected);
90         }
91         
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";
95                 
96                 assertCorrectBinaryString(data, expected);
97         }
98         
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";
102                 
103                 assertCorrectBinaryString(data, expected);
104         }
105         
106 }