diff options
author | Andy Clement <aclement@gopivotal.com> | 2015-01-07 16:22:57 -0800 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2015-01-07 16:22:57 -0800 |
commit | 7569aad932296bce469e719e67a67a8d1bc8bc8b (patch) | |
tree | 5231cf2611cbf74dcacd502e8678be881772efa6 /testing | |
parent | 32aa13acb574980321acc80bacc936c9b2bf505c (diff) | |
download | aspectj-7569aad932296bce469e719e67a67a8d1bc8bc8b.tar.gz aspectj-7569aad932296bce469e719e67a67a8d1bc8bc8b.zip |
456457: unresolvable member fix. Testcode for 456801,455608
Diffstat (limited to 'testing')
-rw-r--r-- | testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java index 0126d29b3..14952a537 100644 --- a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -11,6 +11,7 @@ * ******************************************************************/ package org.aspectj.testing; +import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FilenameFilter; @@ -313,6 +314,22 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { ClassPath cp = new ClassPath(cpentry + File.pathSeparator + System.getProperty("java.class.path")); return SyntheticRepository.getInstance(cp); } + + protected byte[] loadFileAsByteArray(File f) { + try { + byte[] bs = new byte[100000]; + BufferedInputStream bis = new BufferedInputStream(new FileInputStream(f)); + int pos = 0; + int len = 0; + while ((len=bis.read(bs, pos, 100000-pos))!=-1) { + pos+=len; + } + bis.close(); + return bs; + } catch (Exception e) { + return null; + } + } public JavaClass getClassFrom(File where, String clazzname) throws ClassNotFoundException { SyntheticRepository repos = createRepos(where); |