| 1 |
/* |
| 2 |
* Created on 17 gen 2016 |
| 3 |
* Copyright 2015 by Andrea Vacondio ([email protected]). |
| 4 |
* This file is part of Sejda. |
| 5 |
* |
| 6 |
* Sejda is free software: you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU Affero General Public License as published by |
| 8 |
* the Free Software Foundation, either version 3 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* Sejda is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU Affero General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU Affero General Public License |
| 17 |
* along with Sejda. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
*/ |
| 19 |
package org.sejda.conversion; |
| 20 |
|
| 21 |
import static org.junit.Assert.assertEquals; |
| 22 |
|
| 23 |
import org.junit.Test; |
| 24 |
import org.sejda.model.exception.SejdaRuntimeException; |
| 25 |
import org.sejda.model.pdf.PdfVersion; |
| 26 |
|
| 27 |
/** |
| 28 |
* @author Andrea Vacondio |
| 29 |
* |
| 30 |
*/ |
| 31 |
public class PdfVersionAdapterWithFallbackTest { |
| 32 |
@Test |
| 33 |
public void testPositiveFallback() { |
| 34 |
assertEquals(PdfVersion.VERSION_1_4, new PdfVersionAdapterWithFallback("4").getVersion()); |
| 35 |
} |
| 36 |
|
| 37 |
@Test |
| 38 |
public void testPositive() { |
| 39 |
assertEquals(PdfVersion.VERSION_1_6, new PdfVersionAdapterWithFallback("1.6").getVersion()); |
| 40 |
} |
| 41 |
|
| 42 |
@Test(expected = SejdaRuntimeException.class) |
| 43 |
public void missingPoint() { |
| 44 |
new PdfVersionAdapterWithFallback("9").getVersion(); |
| 45 |
} |
| 46 |
|
| 47 |
} |