// Path: api/src/main/java/org/oasis_open/docs/s_ramp/ns/s_ramp_v1/ExtendedArtifactType.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "ExtendedArtifactType")
// public class ExtendedArtifactType
//     extends BaseArtifactType
//     implements Serializable
// {
// 
//     private static final long serialVersionUID = -206412977040808162L;
//     @XmlAttribute(name = "extendedType")
//     protected String extendedType;
// 
//     /**
//      * Gets the value of the extendedType property.
//      * 
//      * @return
//      *     possible object is
//      *     {@link String }
//      *     
//      */
//     public String getExtendedType() {
//         return extendedType;
//     }
// 
//     /**
//      * Sets the value of the extendedType property.
//      * 
//      * @param value
//      *     allowed object is
//      *     {@link String }
//      *     
//      */
//     public void setExtendedType(String value) {
//         this.extendedType = value;
//     }
// 
// }


import org.apache.commons.io.IOUtils;
import org.artificer.atom.archive.ArtificerArchive;
import org.artificer.atom.mappers.RdfToOntologyMapper;
import org.artificer.client.ArtificerAtomApiClient;
import org.artificer.client.ontology.OntologySummary;
import org.artificer.common.query.ArtifactSummary;
import org.artificer.client.query.QueryResultSet;
import org.artificer.common.ArtifactType;
import org.artificer.common.ArtificerModelUtils;
import org.artificer.common.error.ArtificerServerException;
import org.artificer.common.ontology.ArtificerOntology;
import org.junit.Assert;
import org.junit.Test;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactEnum;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedDocument;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XmlDocument;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XsdDocument;
import org.w3._1999._02._22_rdf_syntax_ns_.RDF;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import static org.junit.Assert.fail;
/*
 * Copyright 2012 JBoss Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.artificer.test.client;




/**
 * Unit test for the bulk of the s-ramp client features.
 *
 * @author eric.wittmann@redhat.com
 * @author Brett Meyer
 */
public class ArtificerAtomApiClientTest extends AbstractClientTest {

	/**
	 * Test method for {@link org.artificer.client.ArtificerAtomApiClient#uploadArtifact(java.lang.String, java.lang.String, java.io.InputStream, java.lang.String)}.
	 */
	@Test
	public void testUploadArtifact() throws Exception {
		String artifactFileName = "PO.xsd";
		InputStream is = this.getClass().getResourceAsStream("/sample-files/xsd/" + artifactFileName);
		try {
			ArtificerAtomApiClient client = client();
			BaseArtifactType artifact = client.uploadArtifact(ArtifactType.XsdDocument(), is, artifactFileName);
			Assert.assertNotNull(artifact);
			Assert.assertEquals(artifactFileName, artifact.getName());
		} finally {
			IOUtils.closeQuietly(is);
		}
	}

    /**
     * Test method for {@link org.artificer.client.ArtificerAtomApiClient#createArtifact(BaseArtifactType)}.
     */
    @Test
    public void testCreateArtifact() throws Exception {
// Path: api/src/main/java/org/oasis_open/docs/s_ramp/ns/s_ramp_v1/ExtendedArtifactType.java
// @XmlAccessorType(XmlAccessType.FIELD)
// @XmlType(name = "ExtendedArtifactType")
// public class ExtendedArtifactType
//     extends BaseArtifactType
//     implements Serializable
// {
// 
//     private static final long serialVersionUID = -206412977040808162L;
//     @XmlAttribute(name = "extendedType")
//     protected String extendedType;
// 
//     /**
//      * Gets the value of the extendedType property.
//      * 
//      * @return
//      *     possible object is
//      *     {@link String }
//      *     
//      */
//     public String getExtendedType() {
//         return extendedType;
//     }
// 
//     /**
//      * Sets the value of the extendedType property.
//      * 
//      * @param value
//      *     allowed object is
//      *     {@link String }
//      *     
//      */
//     public void setExtendedType(String value) {
//         this.extendedType = value;
//     }
// 
// }


// Path: test/src/test/java/org/artificer/test/client/ArtificerAtomApiClientTest.java
import org.apache.commons.io.IOUtils;
import org.artificer.atom.archive.ArtificerArchive;
import org.artificer.atom.mappers.RdfToOntologyMapper;
import org.artificer.client.ArtificerAtomApiClient;
import org.artificer.client.ontology.OntologySummary;
import org.artificer.common.query.ArtifactSummary;
import org.artificer.client.query.QueryResultSet;
import org.artificer.common.ArtifactType;
import org.artificer.common.ArtificerModelUtils;
import org.artificer.common.error.ArtificerServerException;
import org.artificer.common.ontology.ArtificerOntology;
import org.junit.Assert;
import org.junit.Test;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactEnum;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedDocument;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XmlDocument;
import org.oasis_open.docs.s_ramp.ns.s_ramp_v1.XsdDocument;
import org.w3._1999._02._22_rdf_syntax_ns_.RDF;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import static org.junit.Assert.fail;

/*
 * Copyright 2012 JBoss Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.artificer.test.client;




/**
 * Unit test for the bulk of the s-ramp client features.
 *
 * @author eric.wittmann@redhat.com
 * @author Brett Meyer
 */
public class ArtificerAtomApiClientTest extends AbstractClientTest {

	/**
	 * Test method for {@link org.artificer.client.ArtificerAtomApiClient#uploadArtifact(java.lang.String, java.lang.String, java.io.InputStream, java.lang.String)}.
	 */
	@Test
	public void testUploadArtifact() throws Exception {
		String artifactFileName = "PO.xsd";
		InputStream is = this.getClass().getResourceAsStream("/sample-files/xsd/" + artifactFileName);
		try {
			ArtificerAtomApiClient client = client();
			BaseArtifactType artifact = client.uploadArtifact(ArtifactType.XsdDocument(), is, artifactFileName);
			Assert.assertNotNull(artifact);
			Assert.assertEquals(artifactFileName, artifact.getName());
		} finally {
			IOUtils.closeQuietly(is);
		}
	}

    /**
     * Test method for {@link org.artificer.client.ArtificerAtomApiClient#createArtifact(BaseArtifactType)}.
     */
    @Test
    public void testCreateArtifact() throws Exception {
        ExtendedArtifactType artifact = new ExtendedArtifactType();