Browse Source

271201: inpath handles

tags/V1_6_5
aclement 15 years ago
parent
commit
212d3c1b66

+ 6
- 0
tests/src/org/aspectj/systemtest/incremental/tools/IncrementalOutputLocationManagerTests.java View File

@@ -12,7 +12,9 @@ package org.aspectj.systemtest.incremental.tools;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import org.aspectj.ajde.core.IOutputLocationManager;

@@ -50,6 +52,10 @@ public class IncrementalOutputLocationManagerTests extends AbstractMultiProjectI

public void reportFileRemove(String outputfile, int filetype) {
}
public Map getInpathMap() {
return Collections.EMPTY_MAP;
}

public File getOutputLocationForClass(File compilationUnit) {
String path = compilationUnit.getAbsolutePath();

+ 6
- 0
tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java View File

@@ -12,6 +12,7 @@ package org.aspectj.systemtest.incremental.tools;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -338,6 +339,11 @@ public class MoreOutputLocationManagerTests extends AbstractMultiProjectIncremen
public File getOutputLocationForClass(File compilationUnit) {
return outputLoc;
}
public Map getInpathMap() {
return Collections.EMPTY_MAP;
}


public File getOutputLocationForResource(File resource) {
return outputLoc;

+ 6
- 0
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjTestOutputLocationManager.java View File

@@ -13,6 +13,7 @@ package org.aspectj.systemtest.incremental.tools;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -40,6 +41,11 @@ public class MultiProjTestOutputLocationManager implements IOutputLocationManage
initLocations();
return classOutputLoc;
}
public Map getInpathMap() {
return Collections.EMPTY_MAP;
}


public File getOutputLocationForResource(File resource) {
initLocations();

+ 76
- 4
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java View File

@@ -2815,6 +2815,78 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
// alter(p,"inc1");
// build(p);
dumptree(root, 0);
PrintWriter pw = new PrintWriter(System.out);
try {
getModelFor(p).dumprels(pw);
pw.flush();
} catch (Exception e) {
}
List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;<codep(Code.class[Code");
assertNotNull(l);
}
public void testInpathHandles_WithInpathMap_271201() throws Exception {
AjdeInteractionTestbed.VERBOSE=true;
String p = "inpathHandles";
initialiseProject(p);

String inpathTestingDir = getWorkingDir() + File.separator + "inpathHandles";
String inpathDir = inpathTestingDir + File.separator + "binpath";// + File.separator+ "codep";
// String expectedOutputDir = inpathTestingDir + File.separator + "bin";

// set up the inpath to have the directory on it's path
System.out.println(inpathDir);
File f = new File(inpathDir);
Set s = new HashSet();
s.add(f);
Map m = new HashMap();
m.put(f,"wibble");
configureOutputLocationManager(p,new TestOutputLocationManager(getProjectRelativePath(p, ".").toString(),m));

configureInPath(p, s);
build(p);

IProgramElement root = getModelFor(p).getHierarchy().getRoot();
// alter(p,"inc1");
// build(p);
dumptree(root, 0);
PrintWriter pw = new PrintWriter(System.out);
try {
getModelFor(p).dumprels(pw);
pw.flush();
} catch (Exception e) {
}
List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;wibble<codep(Code.class[Code");
assertNotNull(l);
}
// warning about cant change parents of Object is fine
// public void testInpathJars_271201() throws Exception {
// AjdeInteractionTestbed.VERBOSE=true;
// String p = "inpathJars";
// initialiseProject(p);
//
// String inpathTestingDir = getWorkingDir() + File.separator + "inpathJars";
// String inpathDir = inpathTestingDir + File.separator + "code.jar";
// // String expectedOutputDir = inpathTestingDir + File.separator + "bin";
//
// // set up the inpath to have the directory on it's path
// System.out.println(inpathDir);
// File f = new File(inpathDir);
// Set s = new HashSet();
// s.add(f);
// Map m = new HashMap();
// m.put(f,"Gibble");
// configureOutputLocationManager(p,new TestOutputLocationManager(getProjectRelativePath(p, ".").toString(),m));
// configureInPath(p, s);
// build(p);
//
// IProgramElement root = getModelFor(p).getHierarchy().getRoot();
//
//// alter(p,"inc1");
//// build(p);
// dumptree(root, 0);
// PrintWriter pw = new PrintWriter(System.out);
// try {
@@ -2822,10 +2894,10 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
// pw.flush();
// } catch (Exception e) {
// }
List l = getModelFor(p).getRelationshipMap().get("=inpathHandles/;<codep(Code.class[Code");
assertNotNull(l);
System.out.println(l.get(0));
}
// List l = getModelFor(p).getRelationshipMap().get("=inpathJars/;Gibble<codep(Code.class[Code");
// assertNotNull(l);
// System.out.println(l.get(0));
// }

// --- helper code ---


+ 6
- 0
tests/src/org/aspectj/systemtest/incremental/tools/OutputLocationManagerTests.java View File

@@ -13,6 +13,7 @@ package org.aspectj.systemtest.incremental.tools;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -104,6 +105,11 @@ public class OutputLocationManagerTests extends AbstractMultiProjectIncrementalA

public void reportFileRemove(String outputfile, int filetype) {
}
public Map getInpathMap() {
return Collections.EMPTY_MAP;
}


public File getOutputLocationForClass(File compilationUnit) {
String relativePath = "";

Loading…
Cancel
Save