a9a3e37da71ec922961509452ffcaab4ba23b135
[zxing.git] / core / test / src / com / google / zxing / oned / rss / expanded / ExpandedInformationDecoderTest.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;
28
29 import com.google.zxing.common.BitArray;
30 import com.google.zxing.oned.rss.expanded.decoders.AbstractExpandedDecoder;
31
32 import junit.framework.TestCase;
33
34 /**
35  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
36  * @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
37  */
38 public final class ExpandedInformationDecoderTest extends TestCase {
39
40   public void testNoAi() throws Exception {
41     BitArray information = BinaryUtil.buildBitArrayFromString(" .......X ..XX..X. X.X....X .......X ....");
42
43     AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(information);
44     String decoded = decoder.parseInformation();
45     assertEquals("(10)12A", decoded);
46   }
47
48 }