unsupported and rotting
[walaincubator.git] / com.ibm.wala.stringAnalysis.js.test / src / com / ibm / wala / domAnalysis / js / translator / test / TestJSTreeTranslatorBase.java
blobfbe9be92411a44c9d765300f9316b3e9073e3c35
1 /******************************************************************************
2 * Copyright (c) 2002 - 2007 IBM Corporation.
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
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *****************************************************************************/
11 package com.ibm.wala.domAnalysis.js.translator.test;
13 import java.io.*;
14 import java.net.*;
15 import java.util.*;
17 import com.ibm.wala.util.debug.Assertions;
18 import com.ibm.wala.cast.js.test.*;
19 import com.ibm.wala.classLoader.*;
20 import com.ibm.wala.domAnalysis.translator.test.TestTreeTranslatorBase;
21 import com.ibm.wala.eclipse.util.CancelException;
22 import com.ibm.wala.ipa.callgraph.propagation.*;
24 abstract public class TestJSTreeTranslatorBase extends TestTreeTranslatorBase {
25 static private ClassLoader loader =
26 TestJSTreeTranslatorBase.class.getClassLoader();
28 protected PropagationCallGraphBuilder makeCallGraphBuilder()
29 throws CancelException
31 return makeCallGraphBuilder("test.js");
34 protected PropagationCallGraphBuilder makeCallGraphBuilder(String testFile)
35 throws CancelException
37 try {
38 URL url = loader.getResource("com/ibm/wala/domAnalysis/js/test/example/" + testFile);
39 PropagationCallGraphBuilder builder =
40 Util.makeCGBuilder(
41 new SourceFileModule[]{
42 Util.makeSourceModule(url, testFile) },
43 false);
44 builder.makeCallGraph( builder.getOptions() );
45 return builder;
46 } catch (IOException e) {
47 Assertions.UNREACHABLE();
48 return null;