At last update to JUnit 4.x
[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 import org.junit.Test;
30
31 /**
32  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
33  */
34 public class AI01_3X0X_1X_DecoderTest extends AbstractDecoderTest {
35         
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";
44
45   @Test
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";
49                 
50                 assertCorrectBinaryString(data, expected);
51         }
52
53   @Test
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";
57                 
58                 assertCorrectBinaryString(data, expected);
59         }
60
61   @Test
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";
65                 
66                 assertCorrectBinaryString(data, expected);
67         }
68
69   @Test
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";
73                 
74                 assertCorrectBinaryString(data, expected);
75         }
76
77   @Test
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";
81                 
82                 assertCorrectBinaryString(data, expected);
83         }
84
85   @Test
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";
89                 
90                 assertCorrectBinaryString(data, expected);
91         }
92
93   @Test
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";
97                 
98                 assertCorrectBinaryString(data, expected);
99         }
100
101   @Test
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";
105                 
106                 assertCorrectBinaryString(data, expected);
107         }
108
109   @Test
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";
113                 
114                 assertCorrectBinaryString(data, expected);
115         }
116         
117 }