2013-05-22 22:39:19 +00:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013 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
|
|
|
|
*******************************************************************************/
|
2012-01-27 20:15:33 +00:00
|
|
|
package com.ibm.wala.cast.js.test;
|
|
|
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
|
|
|
import org.junit.Before;
|
2012-07-03 22:07:20 +00:00
|
|
|
import org.junit.Ignore;
|
2012-01-27 20:15:33 +00:00
|
|
|
import org.junit.Test;
|
|
|
|
|
2012-02-17 20:24:32 +00:00
|
|
|
import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil;
|
2012-01-27 20:15:33 +00:00
|
|
|
import com.ibm.wala.cast.js.html.JSSourceExtractor;
|
|
|
|
import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder;
|
|
|
|
import com.ibm.wala.ipa.callgraph.CallGraph;
|
|
|
|
import com.ibm.wala.util.CancelException;
|
2013-04-09 22:47:22 +00:00
|
|
|
import com.ibm.wala.util.WalaException;
|
2012-01-27 20:15:33 +00:00
|
|
|
|
|
|
|
public class TestJQueryExamples extends TestJSCallGraphShape {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
justThisTest(TestJQueryExamples.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Before
|
|
|
|
public void config() {
|
|
|
|
JSSourceExtractor.USE_TEMP_NAME = false;
|
|
|
|
JSSourceExtractor.DELETE_UPON_EXIT = false;
|
|
|
|
}
|
|
|
|
|
2012-07-03 22:07:20 +00:00
|
|
|
@Ignore("This tries to analyze unmodified jquery, which we can't do yet")
|
2017-07-27 21:53:07 +00:00
|
|
|
@Test public void testEx1() throws IllegalArgumentException, CancelException, WalaException {
|
2012-01-27 20:15:33 +00:00
|
|
|
URL url = getClass().getClassLoader().getResource("pages/jquery/ex1.html");
|
2012-02-17 20:24:32 +00:00
|
|
|
JSCFABuilder builder = JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
|
2012-01-27 20:15:33 +00:00
|
|
|
CallGraph CG = builder.makeCallGraph(builder.getOptions());
|
2017-03-11 18:22:45 +00:00
|
|
|
CAstCallGraphUtil.dumpCG(builder.getCFAContextInterpreter(), builder.getPointerAnalysis(), CG);
|
2012-01-27 20:15:33 +00:00
|
|
|
}
|
|
|
|
}
|