@Test
public void testClassicThemeWab() throws Exception {

	File file = getFile("/classic-theme.autodeployed.war");
	try (Jar jar = new Jar(file)) {
		Assert.assertNull(jar.getBsn());
		Map<String, Resource> resources = jar.getResources();
		Assert.assertEquals(resources.toString(), 1244, resources.size());
	}
	WabProcessor wabProcessor = new TestWabProcessor(
		file,
		HashMapBuilder.put(
			"Bundle-Version", new String[] {"7.0.0.8"}
		).put(
			"Web-ContextPath", new String[] {"/classic-theme"}
		).build());
	File processedFile = wabProcessor.getProcessedFile();
	Assert.assertNotNull(processedFile);
	try (Jar jar = new Jar(processedFile)) {
		Map<String, Map<String, Resource>> directories =
			jar.getDirectories();
		Map<String, Resource> resources = jar.getResources();
		// Check to see that the right number of resources are in the WAB
		Assert.assertEquals(resources.toString(), 1240, resources.size());
		// Check if the basic metadata is correct
		Assert.assertEquals("classic-theme", jar.getBsn());
		Assert.assertEquals("7.0.0.8", jar.getVersion());
		// Assert that the Bundle-ClassPath is properly formed to our
		// conventions
		Domain domain = Domain.domain(jar.getManifest());
		Parameters bundleClassPath = domain.getBundleClassPath();
		Assert.assertEquals(4, bundleClassPath.size());
		Assert.assertTrue(
			bundleClassPath.containsKey("ext/WEB-INF/classes"));
		for (String bundleClassPathEntry : bundleClassPath.keySet()) {
			if (bundleClassPathEntry.equals("ext/WEB-INF/classes")) {
				Assert.assertNull(resources.get(bundleClassPathEntry));
			}
			else if (bundleClassPathEntry.equals("WEB-INF/classes")) {
				Assert.assertNull(resources.get(bundleClassPathEntry));
				Assert.assertTrue(
					directories.containsKey(bundleClassPathEntry));
			}
			else {
				// Check that all the libraries on the Bundle-ClassPath
				// exist in the WAB
				Assert.assertNotNull(resources.get(bundleClassPathEntry));
			}
		}
		Parameters importedPackages = domain.getImportPackage();
		// Check basic servlet and jsp packages are imported
		Assert.assertTrue(importedPackages.containsKey("javax.servlet"));
		Assert.assertTrue(
			importedPackages.containsKey("javax.servlet.http"));
		// Check if packages declared in portal property
		// module.framework.web.generator.default.servlet.packages are
		// included
		Assert.assertTrue(
			importedPackages.containsKey("com.liferay.portal.model"));
		Assert.assertTrue(
			importedPackages.containsKey("com.liferay.portal.service"));
		Assert.assertTrue(
			importedPackages.containsKey(
				"com.liferay.portal.servlet.filters.aggregate"));
		Assert.assertTrue(
			importedPackages.containsKey(
				"com.liferay.portal.osgi.web.servlet.jsp.compiler"));
		Assert.assertTrue(
			importedPackages.containsKey(
				"com.liferay.portal.spring.context"));
		Assert.assertTrue(
			importedPackages.containsKey("com.liferay.portal.util"));
		Assert.assertTrue(
			importedPackages.containsKey("com.liferay.portlet"));
		Assert.assertTrue(importedPackages.containsKey("com.sun.el"));
		Assert.assertTrue(
			importedPackages.containsKey(
				"org.apache.commons.chain.generic"));
		Assert.assertTrue(
			importedPackages.containsKey("org.apache.naming.java"));
		// Check if packages only referenced in web.xml are imported
		Assert.assertTrue(
			importedPackages.containsKey(
				"com.liferay.portal.kernel.servlet.filters.invoker"));
		Assert.assertTrue(
			importedPackages.containsKey("com.liferay.portal.webserver"));
	}
}