Coder Social home page Coder Social logo

Comments (9)

pkriens avatar pkriens commented on June 24, 2024

Can you provide a PR and a test case?

from bndtools.

jellenelis avatar jellenelis commented on June 24, 2024

from bndtools.

pkriens avatar pkriens commented on June 24, 2024

Look at aQute.bnd.repository.osgi.OSGiRepositoryTest in biz.aQute.repository project (test folder. The testRepo() test is testing refresh.

from bndtools.

jellenelis avatar jellenelis commented on June 24, 2024

If I understand correctly testPollingWithFile tests whether or not the repo refreshes based on the polling interval, testBndRepo tests whether getIndex(true) starts a task. Is this correct [not familiar with the bndtools codebase (yet), thanks for any support]?

I can implement a new test case that tests that refreshing actually refreshes the repository, that must be doable.

from bndtools.

pkriens avatar pkriens commented on June 24, 2024

It is a long time ago ... just play with the code and see what happens :-)

from bndtools.

jellenelis avatar jellenelis commented on June 24, 2024

OK, will do, will take a while though.

from bndtools.

pkriens avatar pkriens commented on June 24, 2024

Oh come on, you got the whole evening! :-)

from bndtools.

jellenelis avatar jellenelis commented on June 24, 2024

I wrote a test case for what I think might be the problem, i.e. the index not being updated on refresh. You can find it at jellenelis/bnd@04d14e4. It basically just updates the index (as seen in one of the other tests and checks whether or not the cache of the OSGiIndex actually changes. With the original code, it fails, using true for refresh actually makes the test case pass.

This seems nice, but I saw that there are RepositoryListenerPlugins that would like to be notified whenever a repository is refreshed. I would think they would need to be notified when the user refreshes the repositories as well, or is this not necessary? I did not find a straightforward way to be able to notify them. Depending on your feedback, I might consider adding support for that as well.

from bndtools.

pkriens avatar pkriens commented on June 24, 2024

You can look on MavenBndRepository.refresh() how the notifying of the repository listeners goes

I think you should get the Promise from the OSGiIndex that getIndex created and then on the callback when the promise is satisfied you notify the listeners.

from bndtools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.