Index: test/java/org/apache/ivy/core/resolve/ResolveTest.java
===================================================================
--- test/java/org/apache/ivy/core/resolve/ResolveTest.java	(revision 733025)
+++ test/java/org/apache/ivy/core/resolve/ResolveTest.java	(working copy)
@@ -18,6 +18,7 @@
 package org.apache.ivy.core.resolve;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -27,6 +28,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 
 import javax.xml.parsers.SAXParser;
@@ -3073,6 +3075,27 @@
                 .exists());
     }
 
+    public void testIVY999() throws Exception {
+        ivy.configure(new File("test/repositories/ivy-999/ivysettings.xml"));
+        ivy.getSettings().setDefaultCache(cache);
+
+        ResolveReport rr = ivy.resolve (ResolveTest.class.getResource("ivy-999.xml"));
+        ModuleRevisionId id = rr.getModuleDescriptor().getModuleRevisionId();
+
+        File ivyProperties = ivy.getSettings().getResolutionCacheManager().getResolvedIvyPropertiesInCache(id);
+        Properties props = new Properties();
+        FileInputStream in = new FileInputStream(ivyProperties);
+        props.load(in);
+        in.close();
+        // Read the resovled revision of junit
+        String junitModuleRvIdString = "+revision:#@#:+latest.integration:#@#:+module:#@#:+junit:#@#:+organisation:#@#:+junit:#@#:+branch:#@#:+@#:NULL:#@:#@#:";
+        String[] parts = props.get(junitModuleRvIdString).toString().split (" ");;
+        String revision = parts[0];
+        // The resolved revision should be 4.4 but is latest.integration
+        // Try to exchange the lines wiht "junit" an "test b" in ivy-999.xml and the test succeeds
+        assertEquals ("Bug IVY-999 is still open","4.4", revision);
+    }
+
     public void testBug148b() throws Exception {
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/bug148/ivysettings.xml"));
Index: test/repositories/IVY-999/ivysettings.xml
===================================================================
--- test/repositories/IVY-999/ivysettings.xml	(revision 0)
+++ test/repositories/IVY-999/ivysettings.xml	(revision 0)
@@ -0,0 +1,27 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+<ivysettings>
+   <settings defaultCache="${ivy.settings.dir}/cache" defaultResolver="local" />
+   <resolvers>
+            <filesystem name="local" >
+            <ivy pattern="${ivy.settings.dir}/[organisation]/[module]/ivy-[revision].xml"/>
+            <artifact pattern="${ivy.settings.dir}/[organisation]/[module]/[artifact]-[revision].[ext]"/>
+        </filesystem>
+    </resolvers>
+</ivysettings>
Index: test/repositories/IVY-999/junit/junit/ivy-3.8.xml
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-3.8.xml	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-3.8.xml	(revision 0)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="1.0">
+    <info organisation="junit" module="junit" revision="3.8" status="integration" publication="20090108103716"/>
+    <publications/>
+</ivy-module>
Index: test/repositories/IVY-999/junit/junit/ivy-3.8.xml.md5
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-3.8.xml.md5	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-3.8.xml.md5	(revision 0)
@@ -0,0 +1 @@
+333c9d0108807d1597514a7b406af8a8
\ No newline at end of file
Index: test/repositories/IVY-999/junit/junit/ivy-3.8.xml.sha1
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-3.8.xml.sha1	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-3.8.xml.sha1	(revision 0)
@@ -0,0 +1 @@
+e434eb8cbf61e059e792d75b5de39fcd110a8181
\ No newline at end of file
Index: test/repositories/IVY-999/junit/junit/ivy-4.4.xml
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-4.4.xml	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-4.4.xml	(revision 0)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="1.0">
+    <info organisation="junit" module="junit" revision="4.4" status="integration" publication="20090108103715"/>
+    <publications/>
+</ivy-module>
Index: test/repositories/IVY-999/junit/junit/ivy-4.4.xml.md5
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-4.4.xml.md5	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-4.4.xml.md5	(revision 0)
@@ -0,0 +1 @@
+525d5b0b98457b122fc753098c90ff2c
\ No newline at end of file
Index: test/repositories/IVY-999/junit/junit/ivy-4.4.xml.sha1
===================================================================
--- test/repositories/IVY-999/junit/junit/ivy-4.4.xml.sha1	(revision 0)
+++ test/repositories/IVY-999/junit/junit/ivy-4.4.xml.sha1	(revision 0)
@@ -0,0 +1 @@
+6f56f4cb0e63c0862b11f31f032bef5eed8d1f1a
\ No newline at end of file
Index: test/repositories/IVY-999/test/a/ivy-1.xml
===================================================================
--- test/repositories/IVY-999/test/a/ivy-1.xml	(revision 0)
+++ test/repositories/IVY-999/test/a/ivy-1.xml	(revision 0)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ivy-module version="1.4">
+   <info organisation="test" module="a" revision="1" status="integration" publication="20090108103716"/>
+   <publications/>
+   <dependencies>
+      <dependency org="junit" name="junit" rev="4.4"/>
+   </dependencies>
+</ivy-module>
Index: test/repositories/IVY-999/test/a/ivy-1.xml.md5
===================================================================
--- test/repositories/IVY-999/test/a/ivy-1.xml.md5	(revision 0)
+++ test/repositories/IVY-999/test/a/ivy-1.xml.md5	(revision 0)
@@ -0,0 +1 @@
+a5e35b462b6a954409a773a781611c90
\ No newline at end of file
Index: test/repositories/IVY-999/test/a/ivy-1.xml.sha1
===================================================================
--- test/repositories/IVY-999/test/a/ivy-1.xml.sha1	(revision 0)
+++ test/repositories/IVY-999/test/a/ivy-1.xml.sha1	(revision 0)
@@ -0,0 +1 @@
+982806e23857beda54b7b4eaec641b1fc25a43f5
\ No newline at end of file
Index: test/repositories/IVY-999/test/b/ivy-1.5.xml
===================================================================
--- test/repositories/IVY-999/test/b/ivy-1.5.xml	(revision 0)
+++ test/repositories/IVY-999/test/b/ivy-1.5.xml	(revision 0)
@@ -0,0 +1,8 @@
+<ivy-module version="1.0">
+	<info organisation="test" module="b" revision="1.5" status="integration" publication="20090108103716"/>
+    <!-- uispec4j -->
+	<publications/>
+	<dependencies>
+		<dependency org="junit" name="junit" rev="3.8+" conf="default"/>
+	</dependencies>
+</ivy-module>
Index: test/repositories/IVY-999/test/b/ivy-1.5.xml.md5
===================================================================
--- test/repositories/IVY-999/test/b/ivy-1.5.xml.md5	(revision 0)
+++ test/repositories/IVY-999/test/b/ivy-1.5.xml.md5	(revision 0)
@@ -0,0 +1 @@
+5d46fc0c7e6583732d52fe7c1ffefde2
\ No newline at end of file
Index: test/repositories/IVY-999/test/b/ivy-1.5.xml.sha1
===================================================================
--- test/repositories/IVY-999/test/b/ivy-1.5.xml.sha1	(revision 0)
+++ test/repositories/IVY-999/test/b/ivy-1.5.xml.sha1	(revision 0)
@@ -0,0 +1 @@
+0d7b158e71b4ffcdfa269545ae479021c6d2a7ce
\ No newline at end of file
