View | Details | Raw Unified | Return to bug 264788 | Differences between
and this patch

Collapse All | Expand All

(-)test-launching-src/org/eclipse/wst/xsl/launching/tests/testcase/TestInputFileBlock.java (-1 / +1 lines)
Lines 14-20 Link Here
14
14
15
15
16
public class TestInputFileBlock extends TestCase {
16
public class TestInputFileBlock extends TestCase {
17
18
	
17
	
19
	public void testXMLFileExtensions() throws Exception {
18
	public void testXMLFileExtensions() throws Exception {
20
		MockInputFileBlock fileBlock = new MockInputFileBlock(null);
19
		MockInputFileBlock fileBlock = new MockInputFileBlock(null);
Lines 23-28 Link Here
23
		assertTrue("Did not find 'xml'", findExtension("xml", fileExtensions));
22
		assertTrue("Did not find 'xml'", findExtension("xml", fileExtensions));
24
		assertTrue("Did not find 'xsl'", findExtension("xsl", fileExtensions));
23
		assertTrue("Did not find 'xsl'", findExtension("xsl", fileExtensions));
25
		assertTrue("Did not find 'xslt'", findExtension("xslt", fileExtensions));
24
		assertTrue("Did not find 'xslt'", findExtension("xslt", fileExtensions));
25
		assertTrue("Did not find 'fragx'", findExtension("fragx", fileExtensions));
26
	}
26
	}
27
	
27
	
28
	private boolean findExtension(String extension, String[] exts) {
28
	private boolean findExtension(String extension, String[] exts) {
(-)src/org/eclipse/wst/xsl/core/tests/XSLCoreTestSuite.java (+2 lines)
Lines 11-16 Link Here
11
package org.eclipse.wst.xsl.core.tests;
11
package org.eclipse.wst.xsl.core.tests;
12
12
13
13
14
import org.eclipse.wst.xsl.core.internal.utils.tests.TestXMLContentType;
14
import org.eclipse.wst.xsl.internal.core.tests.TestIncludedTemplates;
15
import org.eclipse.wst.xsl.internal.core.tests.TestIncludedTemplates;
15
import org.eclipse.wst.xsl.internal.core.tests.TestXSLCore;
16
import org.eclipse.wst.xsl.internal.core.tests.TestXSLCore;
16
import org.eclipse.wst.xsl.internal.model.tests.TestStylesheet;
17
import org.eclipse.wst.xsl.internal.model.tests.TestStylesheet;
Lines 31-35 Link Here
31
		addTestSuite(TestXSLCore.class);
32
		addTestSuite(TestXSLCore.class);
32
		addTestSuite(TestStylesheet.class);
33
		addTestSuite(TestStylesheet.class);
33
		addTestSuite(TestStylesheetModel.class);
34
		addTestSuite(TestStylesheetModel.class);
35
		addTestSuite(TestXMLContentType.class);
34
	}
36
	}
35
}
37
}
(-)src/org/eclipse/wst/xsl/core/internal/utils/tests/TestXMLContentType.java (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     David Carver (STAR) - bug 264788 - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.xsl.core.internal.utils.tests;
12
13
import org.eclipse.wst.xsl.core.internal.util.XMLContentType;
14
15
import junit.framework.TestCase;
16
17
public class TestXMLContentType extends TestCase {
18
19
	public TestXMLContentType() {
20
		super();
21
	}
22
	
23
	public void testGetFileExtensions() {
24
		XMLContentType xmlContentType = new XMLContentType();
25
		String[] exts = xmlContentType.getFileExtensions();
26
		assertTrue("Missing xslt extension.", findExtension("xslt", exts));
27
		assertTrue("Missing xml extension.", findExtension("xml", exts));
28
		assertTrue("Missing xsl extension.", findExtension("xsl", exts));
29
		assertTrue("Missing fragx extension.", findExtension("fragx", exts));
30
		
31
	}	
32
	
33
	private boolean findExtension(String extension, String[] exts) {
34
		boolean foundsw = false;
35
		for (int i = 0; i < exts.length; i++) {
36
			if (extension.equalsIgnoreCase(exts[i])) {
37
				foundsw = true;
38
			}
39
		}
40
		return foundsw;
41
	}
42
		
43
}

Return to bug 264788