1/*2 * Licensed to the Apache Software Foundation (ASF) under one or more3 * contributor license agreements. See the NOTICE file distributed with4 * this work for additional information regarding copyright ownership.5 * The ASF licenses this file to You under the Apache License, Version 2.06 * (the "License"); you may not use this file except in compliance with7 * the License. You may obtain a copy of the License at8 *9 * http://www.apache.org/licenses/LICENSE-2.010 *11 * Unless required by applicable law or agreed to in writing, software12 * distributed under the License is distributed on an "AS IS" BASIS,13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14 * See the License for the specific language governing permissions and15 * limitations under the License.16 */1718package org.apache.any23.writer;
1920import org.eclipse.rdf4j.rio.RDFFormat;
21import org.junit.Test;
2223importstatic org.junit.Assert.assertEquals;
24importstatic org.junit.Assert.assertNotSame;
25importstatic org.junit.Assert.assertSame;
2627publicclassTripleFormatTest {
2829 @Test
30publicvoid testRdf4jRoundTripping() {
3132 RDFFormat[] formats = { RDFFormat.TRIX, RDFFormat.NQUADS, RDFFormat.RDFA, RDFFormat.TRIG, RDFFormat.N3,
33 RDFFormat.RDFXML, RDFFormat.TURTLE, RDFFormat.JSONLD, RDFFormat.NTRIPLES, RDFFormat.BINARY,
34 RDFFormat.RDFJSON };
3536for (RDFFormat expected : formats) {
37 TripleFormat tf = TripleFormat.of(expected);
3839 RDFFormat actual = tf.toRDFFormat();
40 assertSame(expected, actual);
4142 tf.rdfFormat = null;
43 actual = tf.toRDFFormat();
44 assertNotSame(expected, actual);
4546 assertEquals(expected.getName(), actual.getName());
47 assertEquals(expected.getStandardURI(), actual.getStandardURI());
48 assertEquals(expected.getCharset(), actual.getCharset());
49 assertEquals(expected.getFileExtensions(), actual.getFileExtensions());
50 assertEquals(expected.supportsContexts(), actual.supportsContexts());
51 assertEquals(expected.supportsNamespaces(), actual.supportsNamespaces());
52 }
5354 }
55 }