Recent Changes - Search:

edit SideBar

Osgi2-0

In November 2014, Erwin De Ley worked on getting the ptII repo to be more OSGi complaint.

Resources

Eclipse Instructions

  • Start up Eclipse, create a new workspace.
  • Windows -> Show View -> Others -> SVN Repository
  • Right Click, select New Repository Location
  • Click on the SVN Repo, click on branches, select osgi-2-0
  • Right click on osgi-2-0, Select Find/Check Out As
  • Select Find projects in the children of the selected resource, select Finish. The repo will be scanned for projects.
  • In "Selected projects will be checked out into the workspace", select Finish. There will be lots of errors because ptII is missing
  • In the SVN Repositories tab, check out the ptII repo
    • Right click on the trunk, select Find/Check Out As
    • In Check Out As, keep the default "Check out as a project configured using the New Project Wizard", click on Finish
    • In "Select a wizard", Expand Java and then click on "Java Project", then click on Next.
    • In "Create a Java Project", for Project Name, enter ptII. Under Project Layout, select "Use project folder as root for sources and class files". Click Next.
    • In "Java Settings", select "Allow output folders for source folder", click Finish. ptII will be checked out
    • After ptII is checked out, copy .classpath.default to .classpath. Use either the shell or Window -> Show View -> Navigator.
    • If the ptII project does not build, then right click on the ptII project and select Refresh.
  • Set the PT_LOC variable to the location of the ptII tree:
    • Under Preferences -> General -> Workspace -> Linked resources
    • In the Path Variables section, select New, enter PT_LOC for Name and select Folder
    • Browse to workspace directory, select the ptII directory and click on Open
    • Click on OK
  • Clean all the projects and rebuild: Project -> Clean ...

Problems

StringUtilities.java could not be read

The problem was

The project was not built since the source file /ptolemy.core/linked-src/ptolemy/util/StringUtilities.java could not be read

Solution:

  • Expand ptolemy.core -> linked-src -> ptolemy.util.
  • Right click on the StringUtilities.java, select Properties. Note that the Location is "PT_LOC/ptolemy/util/StringUtilities.java".
  • Click on the Edit button next to the Location. Then Click on Variables. Note that

"PT_LOC" is "/C:/data/build-folders/ptolemy"

  • Click on Edit, then File. Find the ptII directory checked out above

I'm not sure if I got the above right, but I ended up editing the .project files.

ptolemy.moml package.html not found

Solution: Open up the link-source and delete it, it is not necessary.

Do the same with README.txt in that directory.

Change on Nov 27th

PT_LOC variable has been removed from the individual .project files.
You should now set it as a variable for linked resource in your workspace preferences, under General > Workspace > Linked resources > Path variables
PT_LOC should point to the root folder of your workspace.

Continuing along

  • Right clicking on the projects and refreshing helped and finally everything built

Running the test

  • Select org.ptolemy.core.test
  • Run -> Run Configurations. Select Junit, hit the new button and hit Run
  • testModelExecution fails with
java.lang.AssertionError: Wrong iteration count for actor const expected:<1> but was:<0>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:743)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:555)
        at org.ptolemy.testsupport.ModelExecutionAssertion.assertActorIterationStatistics(ModelExecutionAssertion.java:404)
        at org.ptolemy.testsupport.ModelExecutionAssertion.assertModel(ModelExecutionAssertion.java:120)
        at org.ptolemy.core.test.ModelExecutionTest.testModelExecution1(ModelExecutionTest.java:83)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at junit.framework.TestSuite.runTest(TestSuite.java:255)
        at junit.framework.TestSuite.run(TestSuite.java:250)
        at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
 

This is caused by the relience of the flow execution test assertions on using ptolemy DebugListeners. But it seems that currently ptolemy doesn't consistently generate events (cfr also JavaDoc of the ModelExecutionTest). After the release of ptII v10, we can check on how to get this working.

  • testModeDefinition1 passes!

Licenses

$PTII/ptolemy/actor/gui/GenerateCopyrights.java has a generateHTML(Configuration) method that will use reflection to look for classes listed in GenerateCopyrights that have licenses.

org.ptolemy.actor.gui.test/src/test/java/org/ptolemy/actor/gui/test/GenerateHTMLTest.java defines a test that invokes generateHTML(null), which lists that licenses on stdout.

Running the tests in org.ptolemy.actor.gui.test as above will display the licenses in the Eclipse console.

What files are in the sources uses in the branch?

cd ~/src/
https://repo.eecs.berkeley.edu/svn-anon/projects/eal/ptII/branches/osgi-2-0
cd osgi-2-0
grep PT_LOC */.project | awk -F : '{print $2}' | sed 's@<locationURI>PT_LOC/\([^<]*\)</locationURI>@\1@' | awk '{print $1}' | \
sort

677 files, 237k lines

Edit - History - Print - Recent Changes - Search
Page last modified on August 27, 2017, at 03:16 am