Menu

#147 nant build mechanism can not update existing target right

closed
None
5
2008-04-04
2008-04-01
No

See unit test:
emonic.test.NAntBuildBuildFileManipulatorTest
testGetReferencesOf(emonic.test.NAntBuildBuildFileManipulatorTest)
junit.framework.AssertionFailedError: expected:<2> but was:<1>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:282)
at junit.framework.Assert.assertEquals(Assert.java:64)
at junit.framework.Assert.assertEquals(Assert.java:201)
at junit.framework.Assert.assertEquals(Assert.java:207)
at emonic.test.NAntBuildBuildFileManipulatorTest.testGetReferencesOf(NAntBuildBuildFileManipulatorTest.java:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58)
at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:105)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3157)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2859)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.run(UITestApplication.java:45)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

Discussion

  • Bernhard Brem

    Bernhard Brem - 2008-04-01
    • status: open --> closed
     
  • Bernhard Brem

    Bernhard Brem - 2008-04-01

    Logged In: YES
    user_id=1245734
    Originator: YES

    Fixed in CVS.

     
  • Remy Chi Jian Suen

    • status: closed --> open
     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: NO

    This still fails for me.

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-03

    Logged In: YES
    user_id=1245734
    Originator: YES

    Exactly the same bug? Sis You update the NAntBuildFileManipulator itself or only the test? (it was a bug in the manipulator)

    If yes:
    Could You:
    - run the failing test in debug mode till line 347 of NAntBuildFileManipulatorTest
    - go in the junit-workspace/nanttestproject and look at the content of build.xml?

    There _should_ be 2 references set:
    <references>
    <include name='System.dll'/>
    <include name='System.Xml.dll'/>
    </references>

    The whole file should look like:
    bb@bsp2:~/junit-workspace/nanttestproject> cat build.xml
    <?xml version='1.0'?>
    <project basedir='.' default='all' name=''>
    <property name='build' value='bin'/>
    <property name='src' value='src'/>
    <property name='nant.settings.currentframework' value='mono-1.0'/>
    <property name='build' value='bin'/>
    <property name='src' value='src'/>
    <target depends='test,test' name='all'/>
    <target name='test'>
    <csc debug='true' optimize='true' output='${build}/test.exe' target='exe' warninglevel='4'>
    <define name='DEBUG;TRACE'/>
    <sources>
    <include name='${src}/Main.cs'/>
    </sources>
    <references>
    <include name='System.dll'/>
    <include name='System.Xml.dll'/>
    </references>
    </csc>
    </target>
    </project>

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-03
    • assigned_to: nobody --> bernhardbrem
     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: NO

    On my computer, the file looks like this:
    <?xml version='1.0'?>
    <project basedir='.' default='all' name=''>
    <property name='build' value='bin'/>
    <property name='src' value='src'/>
    <property name='nant.settings.currentframework' value='mono-1.0'/>
    <property name='build' value='bin'/>
    <property name='src' value='src'/>
    <target depends='test,test' name='all'/>
    <target name='test'>
    <csc debug='true' optimize='true' output='${build}/test.exe' target='exe' warninglevel='4'>
    <sources>
    <include name='${src}/Main.cs'/>
    </sources>
    <define name='DEBUG;TRACE'/>
    <references>
    <include name='System.dll'/>
    </references>
    <sources>
    <include name='${src}/Main.cs'/>
    </sources>
    <references>
    <include name='System.dll'/>
    <include name='System.Xml.dll'/>
    </references>
    </csc>
    </target>
    </project>

    Note how there are _two_ references XML elements. And yes, I synchronized all my files against CVS.

    I see you made a change on April 1st but it doesn't seem to really be related.
    http://emonic.cvs.sourceforge.net/emonic/emonic.base/src/org/emonic/base/filemanipulators/NAntBuildfileManipulator.java?r1=1.2&r2=1.3

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-03

    Logged In: YES
    user_id=1245734
    Originator: YES

    > I see you made a change on April 1st but it doesn't seem to
    > really be related.

    No, it is no joke :-(

    The problem which I tried to address with the fixture is:
    --snip
    <references>
    <include name='System.dll'/>
    </references>
    <sources>
    <include name='${src}/Main.cs'/>
    </sources>
    <references>
    <include name='System.dll'/>
    <include name='System.Xml.dll'/>
    </references>
    --snip

    i.e. You have 2 references node where only one should be.
    For that reason I repaired the filemanipulator. And -as I
    realized in this moment - did something wrong with updating
    the CVS......

    Now it should work.

     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: NO

    Just updated to CVS HEAD, check. Runs fine now, Bernhard, thanks.

     
  • Bernhard Brem

    Bernhard Brem - 2008-04-04
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB