Skip to content
TapSchemaMangerTest.java 2.78 KiB
Newer Older
/* 
 * _____________________________________________________________________________
 * 
 * INAF - OATS National Institute for Astrophysics - Astronomical Observatory of
 * Trieste INAF - IA2 Italian Center for Astronomical Archives
 * _____________________________________________________________________________
 * 
 * Copyright (C) 2016 Istituto Nazionale di Astrofisica
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License Version 3 as published by the
 * Free Software Foundation.
 * 
 * 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, write to the Free Software Foundation, Inc., 51
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
import it.inaf.ia2.tsm.webapp.SeparateCredentials;
import it.inaf.ia2.tsm.api.Credentials;
import it.inaf.ia2.tsm.webapp.xmlconfig.UserConfiguration;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXB;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Ignore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 * @author Sonia Zorba {@literal <zorba at oats.inaf.it>}
 */
public class TapSchemaMangerTest {

    private static final Logger LOG = LoggerFactory.getLogger(TapSchemaMangerTest.class);
    public TapSchemaMangerTest() {
    }

    @BeforeClass
    public static void setUpClass() {
    }

    @AfterClass
    public static void tearDownClass() {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void testCredentialsConfigSerialization() throws Exception {
//        CredentialsConfiguration cc = new CredentialsConfiguration();
//
//        UserConfiguration uc = new UserConfiguration();
//        cc.getUsers().add(uc);
//
//        uc.addCredentials(new Credentials());
//
//        SeparateCredentials sc = new SeparateCredentials();
//        sc.setSourceCredentials(new Credentials());
//        sc.setTapSchemaCredentials(new Credentials());
//        uc.addSeparateCredentials(sc);
//
//        StringWriter sw = new StringWriter();
//        JAXB.marshal(cc, sw);
//
//        StringReader sr = new StringReader(sw.toString());
//
//        cc = JAXB.unmarshal(sr, CredentialsConfiguration.class);
//        sw = new StringWriter();
//        JAXB.marshal(cc, sw);
//
//        LOG.debug(sw.toString());
//        sw.close();