Small style stuff
[zxing.git] / core / test / src / com / google / zxing / oned / rss / expanded / decoders / AI01_3103_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 com.google.zxing.NotFoundException;
30 import org.junit.Test;
31
32 /**
33  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
34  */
35 public class AI01_3103_DecoderTest extends AbstractDecoderTest {
36         
37         private static final String header = "..X..";
38
39   @Test
40         public void test01_3103_1() throws Exception {
41                 String data = header + compressedGtin_900123456798908 + compressed15bitWeight_1750;
42                 String expected = "(01)90012345678908(3103)001750";
43                 
44                 assertCorrectBinaryString(data, expected);
45         }
46
47   @Test
48         public void test01_3103_2() throws Exception {
49                 String data = header + compressedGtin_900000000000008 + compressed15bitWeight_0;
50                 String expected = "(01)90000000000003(3103)000000";
51                 
52                 assertCorrectBinaryString(data, expected);
53         }
54
55   @Test
56         public void test01_3103_invalid() throws Exception {
57                 String data = header + compressedGtin_900123456798908 + compressed15bitWeight_1750 + "..";
58                 
59                 try{
60                         assertCorrectBinaryString(data, "");
61                         fail(NotFoundException.class.getName() + " expected");
62                 }catch(NotFoundException nfe){
63                         // expected
64                 }
65         }
66 }