[
https://issues.apache.org/jira/browse/JENA-1350?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16027925#comment-16027925
]
Andy Seaborne commented on JENA-1350:
-------------------------------------
{{ServerCtl}} becomes {{FusekiTestServer}}. In fact, with embedded Fuseki, it
is quite simple to just run the server, beforeClass/afterClass and not need a
test harness. The dataset in the server can be manipulated from the tests.
{noformat}
private static FusekiEmbeddedServer server ;
private static DatasetGraph serverdsg = DatasetGraphFactory.createTxnMem() ;
@BeforeClass
public static void beforeClass() {
server = FusekiEmbeddedServer.create()
.setPort(....)
.add("/ds", serverdsg)
.build()
.start();
}
@Before
public void beforeTest() {
// Clear up data in server servers
Txn.executeWrite(serverdsg, ()->serverdsg.clear()) ;
}
@AfterClass
public static void afterClass() {
server.stop();
}
{noformat}
> Embedded Fuseki for testing usage
> ---------------------------------
>
> Key: JENA-1350
> URL: https://issues.apache.org/jira/browse/JENA-1350
> Project: Apache Jena
> Issue Type: Improvement
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
>
> Provide {{ServerCtl}} (see the full server and Fuseki1) for test cycle
> support.
> Enable the possibility of security in embedded Fuseki for testing purposes.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)