AbstractStandalone extends AbstractConsole<T> implements Standalone<T>, Runnable { @Override public T contextPath(String contextPath) { checkContextPath(contextPath); this.contextPath = contextPath; return (T)this; } AbstractStandalone(String name); @Override final void run(); @Override final T join(); @Override Integer getPort(); @Override T port(int port); @Override String getHost(); @Override T host(String host); @Override Long getIdleTimeout(); @Override T idleTimeout(long idleTimeout); @Override String getContextPath(); @Override T contextPath(String contextPath); @Override Integer getSslPort(); @Override T sslPort(int sslPort); @Override URI getSslKeystoreUri(); @Override T sslKeystoreUri(URI keystoreUri); @Override String getSslKeystorePassword(); @Override T sslKeystorePassword(String keystorePassword); @Override URI getSslTruststoreUri(); @Override T sslTruststoreUri(URI truststoreUri); @Override String getSslTruststorePassword(); @Override T sslTruststorePassword(String truststorePassword); @Override List<String> getServerUrls(); @Override List<String> getBaseUrls(); @Override boolean isPortEnabled(); @Override boolean isSslPortEnabled();  }
@Test public void validateContextPath() throws Exception { MockStandalone standalone = new MockStandalone() .externalConfigurationPath("conf/standalone.with.badcontext.conf"); try { standalone.configure(); fail("exception expected"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), containsString("context")); } standalone.contextPath("/goodcontext").configure(); }