/** Set normal mode, including expression evaluation */ public static void setNormalMode() { SystemARQ.StrictDateTimeFO = false ; SystemARQ.ValueExtensions = true ; SystemARQ.EnableRomanNumerals = false ; setNormalMode(ARQ.getContext()) ; }
@Test public void testStringTimeout2() { BasicPattern basicPattern = new BasicPattern(); basicPattern.add(Triple.ANY); Node serviceNode = NodeFactory.createURI(SERVICE); OpService opService = new OpService(serviceNode, new OpBGP(basicPattern), false); Context context = new Context(); ARQ.setNormalMode(context); context.set(Service.queryTimeout, "10,10000"); try { Service.exec(opService, context); Assert.fail("Expected QueryExceptionHTTP"); } catch (QueryExceptionHTTP expected) { Throwable thrown = expected.getCause() ; if ( thrown instanceof SocketException || thrown instanceof ConnectTimeoutException ) { // expected } else { Assert.fail(String.format("Expected SocketException or ConnectTimeoutException, instead got: %s %s", thrown.getClass().getName(), thrown.getMessage())); } } }
@Test public void testNumericTimeout() { BasicPattern basicPattern = new BasicPattern(); basicPattern.add(Triple.ANY); Node serviceNode = NodeFactory.createURI(SERVICE); OpService opService = new OpService(serviceNode, new OpBGP(basicPattern), false); Context context = new Context(); ARQ.setNormalMode(context); context.set(Service.queryTimeout, 10); try { Service.exec(opService, context); Assert.fail("Expected QueryExceptionHTTP"); } catch (QueryExceptionHTTP expected) { Throwable thrown = expected.getCause() ; if ( thrown instanceof SocketException || thrown instanceof ConnectTimeoutException ) { // expected } else { Assert.fail(String.format("Expected SocketException or ConnectTimeoutException, instead got: %s %s", thrown.getClass().getName(), thrown.getMessage())); } } }
@Test public void testStringTimeout() { BasicPattern basicPattern = new BasicPattern(); basicPattern.add(Triple.ANY); Node serviceNode = NodeFactory.createURI(SERVICE); OpService opService = new OpService(serviceNode, new OpBGP(basicPattern), false); Context context = new Context(); ARQ.setNormalMode(context); context.set(Service.queryTimeout, "10"); try { Service.exec(opService, context); Assert.fail("Expected QueryExceptionHTTP"); } catch (QueryExceptionHTTP expected) { Throwable thrown = expected.getCause() ; if ( thrown instanceof SocketException || thrown instanceof ConnectTimeoutException ) { // expected } else { Assert.fail(String.format("Expected SocketException or ConnectTimeoutException, instead got: %s %s", thrown.getClass().getName(), thrown.getMessage())); } } }