<commit_before>/**
 * 
 */
package org.ops4j.pax.web.itest.karaf;

import static org.ops4j.pax.exam.OptionUtils.combine;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.web.service.spi.WebEvent;
import org.ops4j.pax.web.service.spi.WebListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author achim
 * 
 */
@RunWith(PaxExam.class)
public class WarKarafTest extends KarafBaseTest {

	Logger LOG = LoggerFactory.getLogger(WarKarafTest.class);

	private org.ops4j.pax.web.itest.karaf.WarKarafTest.WebListenerImpl webListener;

	private Bundle warBundle;

	@Configuration
	public Option[] config() {

		return combine(jettyConfig(), new VMOption("-DMyFacesVersion="
				+ getMyFacesVersion()));
	}

	@Test
	public void testWC() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc", "<h1>Hello World</h1>");

	}

	@Test
	public void testWC_example() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/example",
				"<h1>Hello World</h1>");

		testClient.testWebPath("http://127.0.0.1:8181/war/images/logo.png", "", 200, false);

	}

	@Test
	public void testWC_SN() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/sn", "<h1>Hello World</h1>");

	}

	@Test
	public void testSlash() throws Exception {

		//testClient.testWebPath("http://127.0.0.1:8181/war/", "<h1>Error Page</h1>", 404, false);
		testClient.testWebPath("http://127.0.0.1:8181/war/", null, 403, false);

	}

	@Test
	public void testSubJSP() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/subjsp",<commit_msg>[PAXWEB-715] - Tests containing JSPs fails for running with equinox <commit_after>/**
 * 
 */
package org.ops4j.pax.web.itest.karaf;

import static org.ops4j.pax.exam.OptionUtils.combine;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.web.service.spi.WebEvent;
import org.ops4j.pax.web.service.spi.WebListener;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author achim
 * 
 */
@RunWith(PaxExam.class)
public class WarKarafTest extends KarafBaseTest {

	Logger LOG = LoggerFactory.getLogger(WarKarafTest.class);

	private org.ops4j.pax.web.itest.karaf.WarKarafTest.WebListenerImpl webListener;

	private Bundle warBundle;

	@Configuration
	public Option[] config() {

		return combine(jettyConfig(), new VMOption("-DMyFacesVersion="
				+ getMyFacesVersion()));
	}

	@Test
	public void testWC() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc", "<h1>Hello World</h1>");

	}

	@Test
	public void testWC_example() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/example",
				"<h1>Hello World</h1>");

		testClient.testWebPath("http://127.0.0.1:8181/war/images/logo.png", "", 200, false);

	}

	@Test
	public void testWC_SN() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/sn", "<h1>Hello World</h1>");

	}

	@Test
	public void testSlash() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/", "<h1>Error Page</h1>", 404, false);

	}

	@Test
	public void testSubJSP() throws Exception {

		testClient.testWebPath("http://127.0.0.1:8181/war/wc/subjsp",
{'fraction_non_alphanumeric': 0.1595381789556547, 'fraction_numerical': 0.048806087641039095, 'mean_word_length': 4.500721500721501, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 13, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6351147', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1452, 'n_words': 228}