/* Copyright (C) 2014  Egon Willighagen <egonw@users.sf.net>
 * 
 * Contact: cdk-devel@lists.sourceforge.net
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 * All we ask is that proper credit is given for our work, which includes
 * - but is not limited to - adding the above copyright notice to the beginning
 * of your source code files, and to any copyright notice that you may distribute
 * with programs based on this work.
 * 
 * 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 Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package com.github.egonw.ops4j;

import java.io.IOException;

import org.apache.http.HttpException;
import org.apache.http.client.ClientProtocolException;
import org.junit.Assert;
import org.junit.Test;

public class PathwaysTest extends AbstractOPS4JTest {

	{ super.pickUpConfig(); }

	@Test
	public void count() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.count();
		System.out.println(turtle);
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
	}

	@Test
	public void list() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.list(1, 5);
		System.out.println(turtle);
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
		Assert.assertTrue(turtle.contains("<http://rdf.wikipathways.org/Pathway/WP"));
	}

	@Test
	public void info() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.info("http://identifiers.org/wikipathways/WP1019");
		System.out.println(turtle);
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
		Assert.assertTrue(turtle.contains("http://identifiers.org/wikipathways/WP1019"));
	}

	@Test
	public void getCompounds() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.getCompounds("http://identifiers.org/wikipathways/WP1019");
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
		Assert.assertTrue(turtle.contains("http://identifiers.org/hmdb/HMDB01429"));
	}

	@Test
	public void getTargets() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.getTargets("http://identifiers.org/wikipathways/WP1019");
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
		Assert.assertTrue(turtle.contains("http://identifiers.org/ncbigene/493720"));
	}

	@Test
	public void getPublications() throws ClientProtocolException, IOException, HttpException {
		Pathways client = Pathways.getInstance(super.server, super.appID, super.appKey);
		Assert.assertNotNull(client);
		String turtle = client.getPublications("http://identifiers.org/wikipathways/WP1019");
		Assert.assertNotNull(turtle);
		Assert.assertTrue(turtle.contains("prefix"));
		Assert.assertTrue(turtle.contains("http://identifiers.org/pubmed/10914538"));
	}

}

@@ -1650,38 +1650,8 @@
 ();%0A
-%09%09System.out.println(turtle);%0A
 %09%09As
@@ -1974,38 +1974,8 @@
 5);%0A
-%09%09System.out.println(turtle);%0A
 %09%09As
@@ -2419,38 +2419,8 @@
 %22);%0A
-%09%09System.out.println(turtle);%0A
 %09%09As

Remove some STDOUT