Skip to content

Commit

Permalink
Fix test failure purely caused by a naming issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
rjust committed Sep 9, 2024
1 parent a6f8d48 commit 5e6aef6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
19 changes: 18 additions & 1 deletion framework/core/Project/JxPath.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,25 @@ sub determine_layout {
#
sub _post_checkout {
my ($self, $rev_id, $work_dir) = @_;

my $vid = $self->{_vcs}->lookup_vid($rev_id);
my $project_dir = "$PROJECTS_DIR/$self->{pid}";

# Fix compilation errors if necessary.
# Run this as the first step to ensure that patches are applicable to
# unmodified source files.
my $compile_errors = "$PROJECTS_DIR/$self->{pid}/compile-errors/";
opendir(DIR, $compile_errors) or die "Could not find compile-errors directory.";
my @entries = readdir(DIR);
closedir(DIR);
foreach my $file (@entries) {
if ($file =~ /-(\d+)-(\d+).diff/) {
if ($vid >= $1 && $vid <= $2) {
$self->apply_patch($work_dir, "$compile_errors/$file")
or die("Couldn't apply patch ($file): $!");
}
}
}

# Check whether ant build file exists
unless (-e "$work_dir/build.xml") {
my $build_files_dir = "$PROJECTS_DIR/$PID/build_files/$rev_id";
Expand Down
22 changes: 22 additions & 0 deletions framework/projects/JxPath/compile-errors/LazyDynaBean-20-22.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/src/test/org/apache/commons/jxpath/ri/model/dynabeans/LazyDynaBeanTest.java b/src/test/org/apache/commons/jxpath/ri/model/dynabeans/LazyDynaBeanTest.java
index 7caead9..8fde0b3 100644
--- a/src/test/org/apache/commons/jxpath/ri/model/dynabeans/LazyDynaBeanTest.java
+++ b/src/test/org/apache/commons/jxpath/ri/model/dynabeans/LazyDynaBeanTest.java
@@ -28,7 +28,7 @@ import org.apache.commons.jxpath.ri.JXPathContextReferenceImpl;
*/
public class LazyDynaBeanTest extends JXPathTestCase {

- public void testLazyProperty() throws JXPathNotFoundException {
+ public void runLazyProperty() throws JXPathNotFoundException {
LazyDynaBean bean = new LazyDynaBean();
JXPathContext context = JXPathContext.newContext(bean);
context.getValue("nosuch");
@@ -37,7 +37,7 @@ public class LazyDynaBeanTest extends JXPathTestCase {
public void testStrictLazyDynaBeanPropertyFactory() {
JXPathContextReferenceImpl.addNodePointerFactory(new StrictLazyDynaBeanPointerFactory());
try {
- testLazyProperty();
+ runLazyProperty();
fail();
} catch (JXPathNotFoundException e) {
//okay

0 comments on commit 5e6aef6

Please sign in to comment.