2007-02-02 17:28:04 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* Copyright (c) 2002 - 2006 IBM Corporation.
|
|
|
|
* All rights reserved. This program and the accompanying materials
|
|
|
|
* are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
* which accompanies this distribution, and is available at
|
|
|
|
* http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* IBM Corporation - initial API and implementation
|
|
|
|
*****************************************************************************/
|
|
|
|
package com.ibm.wala.cast.js.test;
|
|
|
|
|
2007-07-11 21:08:26 +00:00
|
|
|
import java.net.URL;
|
2007-02-02 17:28:04 +00:00
|
|
|
|
2007-07-11 21:08:26 +00:00
|
|
|
import junit.framework.Assert;
|
2007-02-02 17:28:04 +00:00
|
|
|
|
2009-07-27 23:21:22 +00:00
|
|
|
import org.junit.Test;
|
|
|
|
|
2007-07-11 21:08:26 +00:00
|
|
|
import com.ibm.wala.cast.js.util.WebUtil;
|
|
|
|
import com.ibm.wala.classLoader.Module;
|
|
|
|
import com.ibm.wala.core.tests.util.WalaTestCase;
|
2007-02-02 17:28:04 +00:00
|
|
|
|
|
|
|
public class TestWebUtil extends WalaTestCase {
|
|
|
|
|
2009-07-27 23:21:22 +00:00
|
|
|
@Test public void testAjaxslt() {
|
2007-02-02 22:26:38 +00:00
|
|
|
URL url = getClass().getClassLoader().getResource("ajaxslt/test/xslt.html");
|
2007-02-02 17:28:04 +00:00
|
|
|
Assert.assertTrue(url != null);
|
|
|
|
Module mod = WebUtil.extractScriptFromHTML( url );
|
|
|
|
Assert.assertTrue(mod != null);
|
|
|
|
}
|
|
|
|
|
2009-07-27 23:21:22 +00:00
|
|
|
@Test public void testAjaxpath() {
|
2007-02-02 22:26:38 +00:00
|
|
|
URL url = getClass().getClassLoader().getResource("ajaxslt/test/xpath.html");
|
2007-02-02 17:28:04 +00:00
|
|
|
Assert.assertTrue(url != null);
|
|
|
|
Module mod = WebUtil.extractScriptFromHTML( url );
|
|
|
|
Assert.assertTrue(mod != null);
|
|
|
|
}
|
|
|
|
}
|