<%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%><%@ page import="javax.jcr.Session, javax.jcr.Node, javax.jcr.NodeIterator, java.text.SimpleDateFormat, java.util.*, org.apache.jackrabbit.tck.WebAppTestConfig, org.apache.jackrabbit.test.JNDIRepositoryStub, org.apache.jackrabbit.tck.WebAppTestConfig, org.apache.jackrabbit.tck.j2ee.RepositoryServlet, org.apache.jackrabbit.tck.TestFinder, junit.framework.TestSuite" %><%@page session="false" %><% Session repSession = RepositoryServlet.getSession(); if (repSession == null) { return; } %>
<% // save test configuration WebAppTestConfig.save(request, repSession); // check for property additions String newid = request.getParameter("newid"); String newvalue = request.getParameter("newvalue"); if (newvalue != null && !"".equals(newvalue) && newid != null && !"".equals(newid)) { WebAppTestConfig.saveProperty(newid, newvalue, repSession); } // reset to default configuration (from properties file) if requested String resetConfig = request.getParameter("resetconfig"); if (resetConfig != null && "yes".equals(resetConfig)) { WebAppTestConfig.resetConfiguration(); } // load current configuration Map props = WebAppTestConfig.getCurrentConfig(); %>
<% // display default config for (int i = 0; i < WebAppTestConfig.propNames.length; i++) { String name = WebAppTestConfig.propNames[i]; String value = (String) props.get(name); %><% } // display test suite specific configs TestFinder tf = new TestFinder(); tf.find(getServletConfig().getServletContext().getResource(RepositoryServlet.getTckWebappJarPath()).openStream(), "TestAll.java"); Iterator tests = tf.getSuites().keySet().iterator(); tests = tf.getSuites().keySet().iterator(); while (tests.hasNext()) { String key = (String) tests.next(); TestSuite t = (TestSuite) tf.getSuites().get(key); Map configs = WebAppTestConfig.getTestCaseSpecificConfigs(t); if (configs.size() > 0) { %><% Iterator citr = configs.keySet().iterator(); while (citr.hasNext()) { String ckey = (String) citr.next(); // split title if too long String title = (ckey.length() > 70) ? ckey.substring(0, 70) + " " + ckey.substring(71) : ckey; %><% } %><% } } %>
Default Configuration
<%= name %>
<%= key %>
<%= title %>
Set default configuration