/* * GeoBatch - Open Source geospatial batch processing system * https://github.com/nfms4redd/nfms-geobatch * Copyright (C) 2007-2012 GeoSolutions S.A.S. * http://www.geo-solutions.it * * GPLv3 + Classpath exception * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package it.geosolutions.geoserver.decoder; import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder; import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder.VERSION; import junit.framework.Assert; import org.jdom.Element; import org.jdom.output.XMLOutputter; import org.junit.Test; /** * @author Carlo Cancellieri {@code * * * 10-Oct-2013 03:08 * 32db076555e57cc5f826b0361d1af4efe6d3f01b * 2.2-ENTERPRISE-SNAPSHOT * * * 10-Oct-2013 03:01 * da12effd42a9545628bd6e8ec20494607fbfe3a4 * 8-ENTERPRISE-SNAPSHOT * * * } */ public class VersionDecoderTest { private final String version = "10-Oct-2013 03:08" + "32db076555e57cc5f826b0361d1af4efe6d3f01b2.2-ENTERPRISE-SNAPSHOT"; @Test public void testVersionDecoder() { GSVersionDecoder dec=new GSVersionDecoder(version); Assert.assertEquals(VERSION.v22, dec.getVersion()); Assert.assertEquals("GeoServer", dec.getGeoServer().getName()); GSVersionDecoder.GSAboutResource geoserver=dec.getGeoServer(); geoserver.setVersion("2.3-SNAPSHOT"); geoserver.setName("_CustomGeoServerName_"); Assert.assertEquals(VERSION.v23, dec.getVersion()); Assert.assertEquals("_CustomGeoServerName_", dec.getGeoServer().getName()); //print(dec.getRoot()); } public String print(Element e){ return new XMLOutputter().outputString(e); } }