Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
afs committed Oct 23, 2015
1 parent f42d76d commit 85602bc
Showing 1 changed file with 55 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,73 +18,72 @@

package org.apache.jena.fuseki;

import static org.apache.jena.fuseki.ServerTest.* ;
import org.apache.jena.atlas.junit.BaseTest ;
import org.apache.jena.query.* ;
import org.apache.jena.riot.WebContent ;
import org.apache.jena.sparql.engine.http.QueryEngineHTTP ;
import org.apache.jena.sparql.util.Convert ;
import org.apache.jena.update.UpdateExecutionFactory ;
import org.apache.jena.update.UpdateFactory ;
import org.apache.jena.update.UpdateProcessor ;
import org.apache.jena.update.UpdateRequest ;
import org.junit.AfterClass ;
import org.junit.BeforeClass ;
import org.junit.Test ;
import static org.apache.jena.fuseki.ServerTest.*;
import org.apache.jena.atlas.junit.BaseTest;
import org.apache.jena.query.*;
import org.apache.jena.riot.WebContent;
import org.apache.jena.sparql.engine.http.QueryEngineHTTP;
import org.apache.jena.sparql.util.Convert;
import org.apache.jena.update.UpdateExecutionFactory;
import org.apache.jena.update.UpdateFactory;
import org.apache.jena.update.UpdateProcessor;
import org.apache.jena.update.UpdateRequest;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

public class TestSPARQLProtocol extends BaseTest
{
@BeforeClass public static void beforeClass()
{
ServerTest.allocServer() ;
ServerTest.resetServer() ;
@BeforeClass
public static void beforeClass() {
ServerTest.allocServer();
ServerTest.resetServer();
// Load some data.
DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST) ;
du.putModel(model1) ;
du.putModel(gn1, model2) ;
DatasetAccessor du = DatasetAccessorFactory.createHTTP(serviceREST);
du.putModel(model1);
du.putModel(gn1, model2);
}
@AfterClass public static void afterClass()
{
ServerTest.resetServer() ;
ServerTest.freeServer() ;

@AfterClass
public static void afterClass() {
ServerTest.resetServer();
ServerTest.freeServer();
}

static String query(String base, String queryString)
{
return base+"?query="+Convert.encWWWForm(queryString) ;

static String query(String base, String queryString) {
return base + "?query=" + Convert.encWWWForm(queryString);
}
@Test public void query_01()
{
Query query = QueryFactory.create("SELECT * { ?s ?p ?o }") ;
QueryExecution qexec = QueryExecutionFactory.sparqlService(serviceQuery, query) ;
ResultSet rs = qexec.execSelect() ;
int x = ResultSetFormatter.consume(rs) ;
assertTrue( x != 0 ) ;

@Test
public void query_01() {
Query query = QueryFactory.create("SELECT * { ?s ?p ?o }");
QueryExecution qexec = QueryExecutionFactory.sparqlService(serviceQuery, query);
ResultSet rs = qexec.execSelect();
int x = ResultSetFormatter.consume(rs);
assertTrue(x != 0);
}

@Test public void query_02()
{
Query query = QueryFactory.create("SELECT * { ?s ?p ?o }") ;
QueryEngineHTTP engine = QueryExecutionFactory.createServiceRequest(serviceQuery, query) ;
engine.setSelectContentType(WebContent.contentTypeResultsJSON) ;
ResultSet rs = engine.execSelect() ;
int x = ResultSetFormatter.consume(rs) ;
assertTrue( x != 0 ) ;
@Test
public void query_02() {
Query query = QueryFactory.create("SELECT * { ?s ?p ?o }");
QueryEngineHTTP engine = QueryExecutionFactory.createServiceRequest(serviceQuery, query);
engine.setSelectContentType(WebContent.contentTypeResultsJSON);
ResultSet rs = engine.execSelect();
int x = ResultSetFormatter.consume(rs);
assertTrue(x != 0);
}

@Test public void update_01()
{
UpdateRequest update = UpdateFactory.create("INSERT DATA {}") ;
UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, serviceUpdate) ;
proc.execute() ;
@Test
public void update_01() {
UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
UpdateProcessor proc = UpdateExecutionFactory.createRemote(update, serviceUpdate);
proc.execute();
}
@Test public void update_02()
{
UpdateRequest update = UpdateFactory.create("INSERT DATA {}") ;
UpdateProcessor proc = UpdateExecutionFactory.createRemoteForm(update, serviceUpdate) ;
proc.execute() ;

@Test
public void update_02() {
UpdateRequest update = UpdateFactory.create("INSERT DATA {}");
UpdateProcessor proc = UpdateExecutionFactory.createRemoteForm(update, serviceUpdate);
proc.execute();
}
}

0 comments on commit 85602bc

Please sign in to comment.