You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
(46) |
Oct
(102) |
Nov
(10) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(3) |
Mar
(14) |
Apr
(9) |
May
(12) |
Jun
(4) |
Jul
(40) |
Aug
(60) |
Sep
(38) |
Oct
(2) |
Nov
(1) |
Dec
(42) |
2008 |
Jan
(23) |
Feb
(29) |
Mar
(107) |
Apr
(27) |
May
(3) |
Jun
(1) |
Jul
(15) |
Aug
(7) |
Sep
(19) |
Oct
|
Nov
(2) |
Dec
|
2009 |
Jan
(36) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(30) |
Aug
(32) |
Sep
(11) |
Oct
(21) |
Nov
(12) |
Dec
(15) |
2010 |
Jan
(29) |
Feb
(9) |
Mar
(25) |
Apr
|
May
(7) |
Jun
(5) |
Jul
(21) |
Aug
(32) |
Sep
(10) |
Oct
(8) |
Nov
(29) |
Dec
(8) |
2011 |
Jan
(9) |
Feb
(35) |
Mar
(11) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(30) |
2012 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <hu...@us...> - 2007-12-06 20:07:59
|
Revision: 552 http://cishell.svn.sourceforge.net/cishell/?rev=552&view=rev Author: huangb Date: 2007-12-06 12:07:54 -0800 (Thu, 06 Dec 2007) Log Message: ----------- replace File.separator with "/" Modified Paths: -------------- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2007-12-04 18:25:29 UTC (rev 551) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2007-12-06 20:07:54 UTC (rev 552) @@ -32,6 +32,7 @@ import org.cishell.framework.data.Data; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.osgi.service.log.LogService; import org.osgi.service.metatype.MetaTypeProvider; import org.osgi.service.metatype.MetaTypeService; @@ -75,11 +76,13 @@ Data[] data; Dictionary parameters; CIShellContext context; + LogService logger; public StaticExecutableAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { this.data = data; this.parameters = parameters; this.context = context; + logger = (LogService)context.getService(LogService.class.getName()); ALGORITHM = algName + "/"; ALGORITHM_MACOSX_PPC = ALGORITHM + "macosx.ppc/"; @@ -117,7 +120,7 @@ while(e != null && e.hasMoreElements()) { String entryPath = (String) e.nextElement(); - + //logger.log(LogService.LOG_DEBUG, "entry: " + entryPath + "\n\n"); if(entryPath.endsWith("/")) { entries.add(entryPath); } @@ -134,7 +137,9 @@ //take the default, if there if(entries.contains(ALGORITHM_DEFAULT)) { String default_path = ALGORITHM_DEFAULT; - copyDir(dir, default_path); + //logger.log(LogService.LOG_DEBUG, "base path: "+default_path+ + // "\n\t"+dir.getAbsolutePath() + "\n\n"); + copyDir(dir, default_path, 0); } //but override with platform idiosyncracies @@ -153,14 +158,16 @@ if (path == null) { throw new RuntimeException("Unable to find compatible executable"); } else { - copyDir(dir, path); + //logger.log(LogService.LOG_DEBUG, "base path: "+path+ + // "\n\t"+dir.getAbsolutePath() + "\n\n"); + copyDir(dir, path, 0); } } - private void copyDir(File dir, String dirPath) throws IOException { + private void copyDir(File dir, String dirPath, int depth) throws IOException { Enumeration e = bContext.getBundle().getEntryPaths(dirPath); - dirPath = dirPath.replace('/', File.separatorChar); + //dirPath = dirPath.replace('/', File.separatorChar); while (e != null && e.hasMoreElements()) { String path = (String)e.nextElement(); @@ -170,7 +177,9 @@ File subDirectory = new File(dir.getPath() + File.separator + dirName); subDirectory.mkdirs(); - copyDir(subDirectory, path); + //logger.log(LogService.LOG_DEBUG, "path: " + depth + " "+path+ + // "\n\t"+subDirectory.getAbsolutePath() + "\n\n"); + copyDir(subDirectory, path, depth + 1); } else { copyFile(dir, path); } @@ -180,7 +189,7 @@ private void copyFile(File dir, String path) throws IOException { URL entry = bContext.getBundle().getEntry(path); - path = path.replace('/', File.separatorChar); + //path = path.replace('/', File.separatorChar); String file = getName(path); FileOutputStream outStream = new FileOutputStream(dir.getPath() + File.separator + file); @@ -193,11 +202,11 @@ } private String getName(String path) { - if (path.lastIndexOf(File.separator) == path.length()-1) { + if (path.lastIndexOf('/') == path.length()-1) { path = path.substring(0, path.length()-1); } - path = path.substring(path.lastIndexOf(File.separatorChar)+1, + path = path.substring(path.lastIndexOf('/')+1, path.length()); return path; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bh...@us...> - 2007-12-04 18:25:42
|
Revision: 551 http://cishell.svn.sourceforge.net/cishell/?rev=551&view=rev Author: bh2 Date: 2007-12-04 10:25:29 -0800 (Tue, 04 Dec 2007) Log Message: ----------- Moving the old draft spec documentation to make room for the new documentation project that will take its name (org.cishell.docs) Added Paths: ----------- trunk/core/org.cishell.docs.draft-spec/ Removed Paths: ------------- trunk/core/org.cishell.docs/ Copied: trunk/core/org.cishell.docs.draft-spec (from rev 550, trunk/core/org.cishell.docs) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Bruce H. <bh...@bh...> - 2007-12-04 14:18:53
|
oh wait, never mind. Bruce On Dec 4, 2007 9:17 AM, Bruce Herr <bh...@bh...> wrote: > You should also update org.cishell.templates.standalone.executable w/ the > change. These need to be kept in sync (at some point we need to make it so > we only have one version of this). > > Bruce > > > On Dec 3, 2007 5:23 PM, <fu...@us...> wrote: > > > Revision: 550 > > http://cishell.svn.sourceforge.net/cishell/?rev=550&view=rev > > Author: fugu13 > > Date: 2007-12-03 14:23:19 -0800 (Mon, 03 Dec 2007) > > > > Log Message: > > ----------- > > Fix bug that occurs when copying multiple directories. Neighboring > > directories had been copied as nesting directories, because the variable > > holding the directory to copy to was overwritten each time a subdirectory to > > copy was encountered. > > > > Modified Paths: > > -------------- > > > > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > > > > Modified: > > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > > > > =================================================================== > > --- > > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > > 2007-11-14 17:23:59 UTC (rev 549) > > +++ > > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > > 2007-12-03 22:23:19 UTC (rev 550) > > @@ -168,9 +168,9 @@ > > if (path.endsWith ("/")) { > > String dirName = getName(path); > > > > - dir = new File(dir.getPath() + File.separator + > > dirName); > > - dir.mkdirs(); > > - copyDir(dir, path); > > + File subDirectory = new File(dir.getPath() + > > File.separator + dirName); > > + subDirectory.mkdirs(); > > + copyDir(subDirectory, path); > > } else { > > copyFile(dir, path); > > } > > > > > > This was sent by the SourceForge.net collaborative development platform, > > the world's largest Open Source development site. > > > > ------------------------------------------------------------------------- > > > > SF.Net email is sponsored by: The Future of Linux Business White Paper > > from Novell. From the desktop to the data center, Linux is going > > mainstream. Let it simplify your IT future. > > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > > _______________________________________________ > > Cishell-svn mailing list > > Cis...@li... > > https://lists.sourceforge.net/lists/listinfo/cishell-svn > > > > > > -- > Bruce Herr > > Senior Software Developer > Cyberinfrastructure for Network Science Center > School of Library and Information Science > Indiana University > > 10th Street & Jordan Avenue Phone: (812) 856-7034 Fax: -6166 > Main Library 022 E-mail: bh...@bh... > Bloomington, IN 47405, USA -- Bruce Herr Senior Software Developer Cyberinfrastructure for Network Science Center School of Library and Information Science Indiana University 10th Street & Jordan Avenue Phone: (812) 856-7034 Fax: -6166 Main Library 022 E-mail: bh...@bh... Bloomington, IN 47405, USA |
From: Bruce H. <bh...@bh...> - 2007-12-04 14:17:20
|
You should also update org.cishell.templates.standalone.executable w/ the change. These need to be kept in sync (at some point we need to make it so we only have one version of this). Bruce On Dec 3, 2007 5:23 PM, <fu...@us...> wrote: > Revision: 550 > http://cishell.svn.sourceforge.net/cishell/?rev=550&view=rev > Author: fugu13 > Date: 2007-12-03 14:23:19 -0800 (Mon, 03 Dec 2007) > > Log Message: > ----------- > Fix bug that occurs when copying multiple directories. Neighboring > directories had been copied as nesting directories, because the variable > holding the directory to copy to was overwritten each time a subdirectory to > copy was encountered. > > Modified Paths: > -------------- > > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > > Modified: > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > =================================================================== > --- > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > 2007-11-14 17:23:59 UTC (rev 549) > +++ > trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java > 2007-12-03 22:23:19 UTC (rev 550) > @@ -168,9 +168,9 @@ > if (path.endsWith("/")) { > String dirName = getName(path); > > - dir = new File(dir.getPath() + File.separator + > dirName); > - dir.mkdirs(); > - copyDir(dir, path); > + File subDirectory = new File(dir.getPath() + > File.separator + dirName); > + subDirectory.mkdirs(); > + copyDir(subDirectory, path); > } else { > copyFile(dir, path); > } > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > _______________________________________________ > Cishell-svn mailing list > Cis...@li... > https://lists.sourceforge.net/lists/listinfo/cishell-svn > -- Bruce Herr Senior Software Developer Cyberinfrastructure for Network Science Center School of Library and Information Science Indiana University 10th Street & Jordan Avenue Phone: (812) 856-7034 Fax: -6166 Main Library 022 E-mail: bh...@bh... Bloomington, IN 47405, USA |
From: <fu...@us...> - 2007-12-03 22:23:23
|
Revision: 550 http://cishell.svn.sourceforge.net/cishell/?rev=550&view=rev Author: fugu13 Date: 2007-12-03 14:23:19 -0800 (Mon, 03 Dec 2007) Log Message: ----------- Fix bug that occurs when copying multiple directories. Neighboring directories had been copied as nesting directories, because the variable holding the directory to copy to was overwritten each time a subdirectory to copy was encountered. Modified Paths: -------------- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java Modified: trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java =================================================================== --- trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2007-11-14 17:23:59 UTC (rev 549) +++ trunk/templates/org.cishell.templates/src/org/cishell/templates/staticexecutable/StaticExecutableAlgorithmFactory.java 2007-12-03 22:23:19 UTC (rev 550) @@ -168,9 +168,9 @@ if (path.endsWith("/")) { String dirName = getName(path); - dir = new File(dir.getPath() + File.separator + dirName); - dir.mkdirs(); - copyDir(dir, path); + File subDirectory = new File(dir.getPath() + File.separator + dirName); + subDirectory.mkdirs(); + copyDir(subDirectory, path); } else { copyFile(dir, path); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-11-14 17:24:02
|
Revision: 549 http://cishell.svn.sourceforge.net/cishell/?rev=549&view=rev Author: mwlinnem Date: 2007-11-14 09:23:59 -0800 (Wed, 14 Nov 2007) Log Message: ----------- Fixed bug for certain file names. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java Modified: trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2007-10-16 19:30:41 UTC (rev 548) +++ trunk/clients/gui/org.cishell.reference.gui.persistence/src/org/cishell/reference/gui/persistence/save/FileSaver.java 2007-11-14 17:23:59 UTC (rev 549) @@ -203,7 +203,6 @@ //we didn't find an extension on the file name. endIndex = fileLabel.length(); // don't cut any off the end. } - endIndex = Math.min(extensionBeginIndex, fileLabel.length()); String fileNameWithoutExtension = fileNameWithExtension.substring(0, endIndex); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 548 http://cishell.svn.sourceforge.net/cishell/?rev=548&view=rev Author: huangb Date: 2007-10-16 12:30:41 -0700 (Tue, 16 Oct 2007) Log Message: ----------- Add currentValue (static object) to hold previously selected file/directory. However there's a drawback. When multiple algorithms use this GUI builder, the selection will show up cross those multiple algorithms. Currently we can't support preserving the previous selection for each algorithm separately. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/FileComponent.java Modified: trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/FileComponent.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/FileComponent.java 2007-10-05 14:17:09 UTC (rev 547) +++ trunk/clients/gui/org.cishell.reference.gui.guibuilder.swt/src/org/cishell/reference/gui/guibuilder/swt/builder/components/FileComponent.java 2007-10-16 19:30:41 UTC (rev 548) @@ -26,6 +26,7 @@ public class FileComponent extends StringComponent { protected Button browse; + private static Object currentValue; public FileComponent() { this(false, 2); @@ -38,7 +39,7 @@ public Control createGUI(Composite parent, int style) { super.createGUI(parent, style); //creates the text component - Object data = text.getLayoutData(); + Object data = text.getLayoutData(); if (data != null && data instanceof GridData) { GridData gd = (GridData) data; gd.horizontalSpan--; //make room for the browse button @@ -46,10 +47,12 @@ browse = new Button(parent, SWT.PUSH); browse.setText("Browse"); + //when click "Browse", here is the listener browse.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { String fileName = getFile(text.getText()); - + //remember this new file/directory selection + currentValue = fileName; if (fileName != null) { text.setText(fileName); update(); @@ -97,7 +100,17 @@ public void setValue(Object value) { if (value != null && value.toString().equals(getKeyword())) { - value = System.getProperty("user.home"); + +// value = System.getProperty("user.home"); + + //by default, point to NWB or CIShell application installation directory + if (currentValue == null) { + value = System.getProperty("osgi.install.area").replace("file:/",""); + currentValue = value; + } + else + value = currentValue; + } super.setValue(value); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 547 http://cishell.svn.sourceforge.net/cishell/?rev=547&view=rev Author: huangb Date: 2007-10-05 07:17:09 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Change the pop-up menu from "View as" to "View With" and make it consistent with the menu under File Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java Modified: trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java 2007-09-26 22:15:37 UTC (rev 546) +++ trunk/clients/gui/org.cishell.reference.gui.datamanager/src/org/cishell/reference/gui/datamanager/AbstractDataManagerView.java 2007-10-05 14:17:09 UTC (rev 547) @@ -161,7 +161,7 @@ viewItem.addListener(SWT.Selection, viewListener); MenuItem viewWithItem = new MenuItem(menu, SWT.PUSH); - viewWithItem.setText("View as..."); + viewWithItem.setText("View With..."); viewWithListener = new ViewWithListener(); viewWithItem.addListener(SWT.Selection, viewWithListener); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:15:45
|
Revision: 546 http://cishell.svn.sourceforge.net/cishell/?rev=546&view=rev Author: huangb Date: 2007-09-26 15:15:37 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/testing/ Copied: tags/v0.7.0/testing (from rev 545, trunk/testing) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:15:19
|
Revision: 545 http://cishell.svn.sourceforge.net/cishell/?rev=545&view=rev Author: huangb Date: 2007-09-26 15:15:09 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/templates/ Copied: tags/v0.7.0/templates (from rev 544, trunk/templates) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:15:09
|
Revision: 544 http://cishell.svn.sourceforge.net/cishell/?rev=544&view=rev Author: huangb Date: 2007-09-26 15:14:40 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/libs/ Copied: tags/v0.7.0/libs (from rev 543, trunk/libs) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:14:35
|
Revision: 543 http://cishell.svn.sourceforge.net/cishell/?rev=543&view=rev Author: huangb Date: 2007-09-26 15:14:09 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/examples/ Copied: tags/v0.7.0/examples (from rev 542, trunk/examples) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:14:07
|
Revision: 542 http://cishell.svn.sourceforge.net/cishell/?rev=542&view=rev Author: huangb Date: 2007-09-26 15:13:42 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/deployment/ Copied: tags/v0.7.0/deployment (from rev 541, trunk/deployment) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:12:53
|
Revision: 541 http://cishell.svn.sourceforge.net/cishell/?rev=541&view=rev Author: huangb Date: 2007-09-26 15:12:42 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/core/ Copied: tags/v0.7.0/core (from rev 540, trunk/core) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:12:08
|
Revision: 540 http://cishell.svn.sourceforge.net/cishell/?rev=540&view=rev Author: huangb Date: 2007-09-26 15:11:37 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/clients/ Copied: tags/v0.7.0/clients (from rev 539, trunk/clients) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 22:11:21
|
Revision: 539 http://cishell.svn.sourceforge.net/cishell/?rev=539&view=rev Author: huangb Date: 2007-09-26 15:11:11 -0700 (Wed, 26 Sep 2007) Log Message: ----------- tag release v0.7.0 Added Paths: ----------- tags/v0.7.0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 19:47:14
|
Revision: 538 http://cishell.svn.sourceforge.net/cishell/?rev=538&view=rev Author: huangb Date: 2007-09-26 12:47:12 -0700 (Wed, 26 Sep 2007) Log Message: ----------- check in the .project file Added Paths: ----------- trunk/templates/org.cishell.templates.jythonrunner/.project Added: trunk/templates/org.cishell.templates.jythonrunner/.project =================================================================== --- trunk/templates/org.cishell.templates.jythonrunner/.project (rev 0) +++ trunk/templates/org.cishell.templates.jythonrunner/.project 2007-09-26 19:47:12 UTC (rev 538) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.templates.jythonrunner</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + </buildSpec> + <natures> + </natures> +</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@us...> - 2007-09-26 19:32:50
|
Revision: 537 http://cishell.svn.sourceforge.net/cishell/?rev=537&view=rev Author: huangb Date: 2007-09-26 12:32:40 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Update the bundle version to 0.7 and add jythonrunner plugin Modified Paths: -------------- trunk/deployment/org.cishell.reference.feature/feature.xml Modified: trunk/deployment/org.cishell.reference.feature/feature.xml =================================================================== --- trunk/deployment/org.cishell.reference.feature/feature.xml 2007-09-20 21:42:54 UTC (rev 536) +++ trunk/deployment/org.cishell.reference.feature/feature.xml 2007-09-26 19:32:40 UTC (rev 537) @@ -1,18 +1,18 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="org.cishell.reference.feature" - label="CIShell Reference Bundles" - version="0.4.0"> - - <description url="http://cishell.org"> - CIShell Reference Bundles - </description> - - <copyright> - Copyright 2006 Indiana University - </copyright> - - <license url="http://www.apache.org/licenses/LICENSE-2.0"> +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="org.cishell.reference.feature" + label="CIShell Reference Bundles" + version="0.7.0"> + + <description url="http://cishell.org"> + CIShell Reference Bundles + </description> + + <copyright> + Copyright 2006 Indiana University + </copyright> + + <license url="http://www.apache.org/licenses/LICENSE-2.0"> CIShell: Cyberinfrastructure Shell Copyright 2006 Indiana University Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,58 +28,64 @@ Bruce Herr (bh...@bh...) Weixia Huang (hu...@in...) Shashikant Penumarthy (sp...@in...) -Dr. Katy Borner (ka...@in...) - </license> - - <url> - <update label="CIShell Update Site" url="http://cishell.org/update"/> - <discovery label="CIShell Update Site" url="http://cishell.org/update"/> - </url> - - <plugin - id="org.cishell.reference" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin - id="org.cishell.reference.services" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin - id="org.cishell.service.autostart" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin - id="org.cishell.templates" - download-size="0" - install-size="0" - version="0.0.0" - unpack="false"/> - - <plugin - id="edu.uci.ics.jung" - download-size="0" - install-size="0" - version="0.0.0"/> - - <plugin - id="org.apache.commons.collections" - download-size="0" - install-size="0" - version="0.0.0"/> - - <plugin - id="cern.colt" - download-size="0" - install-size="0" - version="0.0.0"/> - -</feature> +Dr. Katy Borner (ka...@in...) + </license> + + <url> + <update label="CIShell Update Site" url="http://cishell.org/update"/> + <discovery label="CIShell Update Site" url="http://cishell.org/update"/> + </url> + + <plugin + id="org.cishell.reference" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.cishell.reference.services" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.cishell.service.autostart" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="org.cishell.templates" + download-size="0" + install-size="0" + version="0.0.0" + unpack="false"/> + + <plugin + id="edu.uci.ics.jung" + download-size="0" + install-size="0" + version="0.0.0"/> + + <plugin + id="org.apache.commons.collections" + download-size="0" + install-size="0" + version="0.0.0"/> + + <plugin + id="cern.colt" + download-size="0" + install-size="0" + version="0.0.0"/> + + <plugin + id="org.cishell.templates.jythonrunner" + download-size="0" + install-size="0" + version="0.0.0"/> + +</feature> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-09-20 21:42:56
|
Revision: 536 http://cishell.svn.sourceforge.net/cishell/?rev=536&view=rev Author: mwlinnem Date: 2007-09-20 14:42:54 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Improved UI for path filters. Removed System.out.printlns. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/HopFilter.java Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-20 21:42:54 UTC (rev 536) @@ -6,12 +6,12 @@ import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; -import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.algorithm.AlgorithmProperty; import org.cishell.framework.data.BasicData; import org.cishell.framework.data.Data; import org.cishell.framework.data.DataProperty; import org.cishell.testing.convertertester.algorithm.pathfilter.ConvAndHopFilter; +import org.cishell.testing.convertertester.algorithm.pathfilter.HopFilter; import org.cishell.testing.convertertester.core.tester2.ConverterTester2; import org.cishell.testing.convertertester.core.tester2.reportgen.ReportGenerator; import org.cishell.testing.convertertester.core.tester2.reportgen.allconvs.AllConvsReportGenerator; @@ -31,7 +31,6 @@ import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; import org.osgi.service.log.LogService; @@ -158,7 +157,8 @@ new ReportGenerator[] {allGen, allConvGen, allErrGen, graphGen, origGraphGen, readmeGen}, - cContext, bContext); + cContext, bContext, + new HopFilter(numHops)); } else { ct.execute(convRefs, new ReportGenerator[] Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-20 21:42:54 UTC (rev 536) @@ -72,18 +72,21 @@ AttributeDefinition.STRING, converterNames, converterNames)); + + definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, + new BasicAttributeDefinition(TEST_ALL_CONVS_PARAM_ID, + "Test All Converters?", + "Should we test all the converters or just the one selected?", + AttributeDefinition.BOOLEAN)); definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, new BasicAttributeDefinition(NUM_HOPS_PARAM_ID, "Max Test Path Length", "What is the maximum length a test path should have to be included", - AttributeDefinition.INTEGER)); + AttributeDefinition.INTEGER, + "6")); - definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, - new BasicAttributeDefinition(TEST_ALL_CONVS_PARAM_ID, - "Test All Converters?", - "Should we test all the converters or just the one selected?", - AttributeDefinition.BOOLEAN)); + MetaTypeProvider provider = new BasicMetaTypeProvider(definition); return provider; Added: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/HopFilter.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/HopFilter.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/HopFilter.java 2007-09-20 21:42:54 UTC (rev 536) @@ -0,0 +1,36 @@ +package org.cishell.testing.convertertester.algorithm.pathfilter; + +import java.util.ArrayList; +import java.util.List; + +import org.cishell.testing.convertertester.core.converter.graph.ConverterPath; +import org.cishell.testing.convertertester.core.tester2.pathfilter.PathFilter; + +public class HopFilter implements PathFilter { + + private int maxNumHops; + + public HopFilter(int maxNumHops) { + this.maxNumHops = maxNumHops; + } + + public ConverterPath[] filter(ConverterPath[] testPaths) { + if (testPaths != null) { + List filteredTestPaths = new ArrayList(); + for (int ii = 0; ii < testPaths.length; ii++) { + ConverterPath testPath = testPaths[ii]; + + if (testPath.size() <= this.maxNumHops) { + filteredTestPaths.add(testPath); + } + } + + return (ConverterPath[]) + filteredTestPaths.toArray(new ConverterPath[0]); + + } else { + return new ConverterPath[0]; + } + } + +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-09-20 21:42:54 UTC (rev 536) @@ -48,13 +48,9 @@ fileExtensionCompareConverters = new ConcurrentHashMap();//<String, ConverterPath>(); - System.out.println("Deriving data formats..."); deriveDataFormats(this.converters, this.dataFormats); - System.out.println("Associating Converters..."); associateConverters(this.converters, this.inDataToConverters, this.outDataToConverters); - System.out.println("Creating converter paths..."); createConverterPaths(this.inDataToConverters, this.fileExtensionTestConverters, this.fileExtensionCompareConverters); - System.out.println("Done creating converter paths..."); } private Converter[] createConverters(ServiceReference[] convRefs) { @@ -105,7 +101,6 @@ String inDataFormat = inDataFormats[i]; if(inDataFormat.startsWith("file-ext")){ - System.out.println("Creating paths for format: " + inDataFormat); ConverterPath test = new ConverterPath(this.bContext, this.log); test.setInData(inDataFormat); @@ -126,20 +121,12 @@ if(currentPath.getInData().equals(currentPath.getOutData())){ //base case addTestCycle(currentPath); - System.out.println("**--Path Completed--**"); List path = currentPath.getPath(); - System.out.println("Path is..."); - for (int ii = 0; ii < path.size(); ii++) { - Converter c = (Converter) path.get(ii); - System.out.println(" " + c.getShortName()); - } - System.out.println("(End Path)"); return; } while(!nextConvs.isEmpty()){ ConverterPath newPath = new ConverterPath(currentPath, this.bContext); Converter nextConv = (Converter) nextConvs.get(0); - System.out.println("Adding " + nextConv.getShortName()); newPath.add(nextConv); nextConvs.remove(0); createPaths((List)this.inDataToConverters.get(newPath.getOutData()), newPath); @@ -161,7 +148,6 @@ if(cp.getOutData() != null){ if(cp.getOutData().equals(ConverterGraph.testOutData)){ String key = cp.getInData() + " " + ((Converter) cp.getPath().get(0)).getOutData(); - //System.out.println(key); if(this.fileExtensionCompareConverters.get(key) == null){ @@ -188,20 +174,9 @@ } else { cs = new ArrayList(); } - System.out.println("Current path is...."); - for (int ii = 0; ii < currentPath.size(); ii++) { - System.out.println(currentPath.get(ii).getShortName()); - } - System.out.println("^^^^ cs prior to removing loop causing convs"); - for (int ii = 0; ii < cs.size(); ii++) { - System.out.println(((Converter) cs.get(ii)).getShortName()); - } cs.removeAll(currentPath.getPath()); - System.out.println("^^^^ cs after removing loop causing convs"); - for (int ii = 0; ii < cs.size(); ii++) { - System.out.println(((Converter) cs.get(ii)).getShortName()); - } + //do we really want to be removing these? List forbidden = new ArrayList(); for(int i = 0; i < cs.size(); i++){ @@ -269,7 +244,6 @@ keySet = (String[])this.fileExtensionCompareConverters.keySet().toArray(keySet); for(int i = 0; i < keySet.length; i++){ String s = keySet[i]; - //System.out.println(s); sb.append(printComparisonConverterPath(s)); } sb.trimToSize(); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-09-20 21:42:54 UTC (rev 536) @@ -127,7 +127,6 @@ Converter c = (Converter) this.path.get(i); if (c.isLossy()) { - System.out.println("FOUND A LOSSY CONVERTER!"); lossiness = LOSSY; } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-09-20 21:42:54 UTC (rev 536) @@ -80,14 +80,12 @@ PathFilter testPathFilter) { //generate all the converter paths - - System.out.println("Generating converter graph paths etc..."); + ConverterGraph converterGraph = new ConverterGraph(converterRefs, bContext, this.log); //run the tests - - System.out.println("Running actual tests..."); + TestResult[] rawResults = runAllTests(converterGraph, testPathFilter, cContext, bContext); @@ -97,7 +95,6 @@ Converter[] allConverters = converterGraph.getAllConverters(); - System.out.println("Running conv result maker..."); ChanceAtFaultHeuristic faultHeuristic = new ErrorProximityHeuristic(); AllConvsResult allConvertersResult = Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2007-09-20 21:26:54 UTC (rev 535) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2007-09-20 21:42:54 UTC (rev 536) @@ -132,7 +132,6 @@ Converter currentConverter = null; try { for (int ii = 0; ii < converters.size(); ii++) { - //System.out.println("Going into converter " + ii); currentConverter = converters.get(ii); //no parameters used This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 535 http://cishell.svn.sourceforge.net/cishell/?rev=535&view=rev Author: mwlinnem Date: 2007-09-20 14:26:54 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Fixed bug in how percentages for summaries in all errors report were calculated. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java 2007-09-20 21:18:13 UTC (rev 534) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java 2007-09-20 21:26:54 UTC (rev 535) @@ -102,22 +102,25 @@ totalChanceAtFaults += pc.getChanceAtFault(); } - List normalizedCafs = new ArrayList(); - for (int ii = 0; ii < pcs.size(); ii++) { - ChanceAtFault pc = (ChanceAtFault) pcs.get(ii); + ChanceAtFault[] uniqueCafs = + removeDuplicateConverters(this.pcs); + + List uniqueNormalizedCafs = new ArrayList(); + for (int ii = 0; ii < uniqueCafs.length; ii++) { + ChanceAtFault pc = uniqueCafs[ii]; ChanceAtFault normPC = new ChanceAtFault( pc.getFailedFilePass(), pc.getConverter(), pc.getChanceAtFault() / totalChanceAtFaults); - normalizedCafs.add(normPC); + uniqueNormalizedCafs.add(normPC); } - ChanceAtFault[] uniqueNormalizedCafs = - removeDuplicateConverters(normalizedCafs); + - return uniqueNormalizedCafs; + return (ChanceAtFault[]) + uniqueNormalizedCafs.toArray(new ChanceAtFault[0]); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 534 http://cishell.svn.sourceforge.net/cishell/?rev=534&view=rev Author: mwlinnem Date: 2007-09-20 14:18:13 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Converter names are now alphabetized in converter selection drop-down list. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-20 21:16:44 UTC (rev 533) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-20 21:18:13 UTC (rev 534) @@ -52,7 +52,9 @@ ConverterTesterAlgorithmUtil. getConverterReferences(bContext)); + Arrays.sort(converterNames); + ObjectClassDefinition oldDefinition = originalProvider.getObjectClassDefinition(this.pid, null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 533 http://cishell.svn.sourceforge.net/cishell/?rev=533&view=rev Author: mwlinnem Date: 2007-09-20 14:16:44 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Untested converters are no longer added as subreports under all convs report (although you can still see which converters weren't tested if you look into the main all convs report). Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-20 21:15:45 UTC (rev 532) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-20 21:16:44 UTC (rev 533) @@ -110,9 +110,6 @@ if (cr.wasTested()) { //add this converters name to all convs report report.println(" " + cr.getShortName()); - - //generate corresponding sub-report - this.convSubGen.generate(cr); } } report.println(""); @@ -124,9 +121,6 @@ if (cr.wasTested()) { //add this converters name to all convs report report.println(" " + cr.getShortName()); - - //generate corresponding sub-report - this.convSubGen.generate(cr); } } @@ -138,16 +132,16 @@ if (! cr.wasTested()) { report.println(" " + cr.getShortName()); - - this.convSubGen.generate(cr); } } report.println(""); for (int ii = 0; ii < convResults.length; ii++) { - this.convSubGen.generate(convResults[ii]); + if (convResults[ii].wasTested()) { + this.convSubGen.generate(convResults[ii]); ConvReport convReport = this.convSubGen.getConvReport(); convReportsList.add(convReport); + } } ConvReport[] convReports = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 532 http://cishell.svn.sourceforge.net/cishell/?rev=532&view=rev Author: mwlinnem Date: 2007-09-20 14:15:45 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Removed slowness warning. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-20 21:07:14 UTC (rev 531) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-20 21:15:45 UTC (rev 532) @@ -68,13 +68,13 @@ } public Data[] execute() { - this.log.log(LogService.LOG_INFO, - "\r\n" + - "-------NOTICE-------" + "\r\n" + - "The Converter Tester will take " + - "some time to run all the tests. \r\n" + - "Thank you for waiting :)" + "\r\n" + - "-----END NOTICE----- \r\n"); +// this.log.log(LogService.LOG_INFO, +// "\r\n" + +// "-------NOTICE-------" + "\r\n" + +// "The Converter Tester will take " + +// "some time to run all the tests. \r\n" + +// "Thank you for waiting :)" + "\r\n" + +// "-----END NOTICE----- \r\n"); Data[] returnDM; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-09-20 21:07:18
|
Revision: 531 http://cishell.svn.sourceforge.net/cishell/?rev=531&view=rev Author: mwlinnem Date: 2007-09-20 14:07:14 -0700 (Thu, 20 Sep 2007) Log Message: ----------- Way too many changes to list. User can now filter reports by converter or by test path length. Handle lossiness correctly now. Lots of little changes to reports. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConvResultMaker.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/fakelogger/FakeLogService.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/TestResult.java Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/ConvAndHopFilter.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/pathfilter/ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/pathfilter/PathFilter.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/ErrorProximityHeuristic.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedTrustHeuristic.java Removed Paths: ------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedFullTrustHeuristic.java Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithm.java 2007-09-20 21:07:14 UTC (rev 531) @@ -11,6 +11,7 @@ import org.cishell.framework.data.BasicData; import org.cishell.framework.data.Data; import org.cishell.framework.data.DataProperty; +import org.cishell.testing.convertertester.algorithm.pathfilter.ConvAndHopFilter; import org.cishell.testing.convertertester.core.tester2.ConverterTester2; import org.cishell.testing.convertertester.core.tester2.reportgen.ReportGenerator; import org.cishell.testing.convertertester.core.tester2.reportgen.allconvs.AllConvsReportGenerator; @@ -44,6 +45,10 @@ private BundleContext bContext; private LogService log; + private boolean testAllConvs; + private String selectedConvName; + private int numHops; + public ConverterTesterAlgorithm(Data[] data, Dictionary parameters, CIShellContext cContext, BundleContext bContext ) { this.cContext = cContext; @@ -52,6 +57,14 @@ this.log = (LogService) cContext.getService( LogService.class.getName()); + + this.testAllConvs = ((Boolean) parameters.get( + ConverterTesterAlgorithmFactory.TEST_ALL_CONVS_PARAM_ID)).booleanValue(); + this.selectedConvName = ((String) parameters.get( + ConverterTesterAlgorithmFactory.SELECTED_CONVERTER_PARAM_ID)); + this.numHops = ((Integer) parameters.get( + ConverterTesterAlgorithmFactory.NUM_HOPS_PARAM_ID)).intValue(); + } public Data[] execute() { @@ -59,7 +72,7 @@ "\r\n" + "-------NOTICE-------" + "\r\n" + "The Converter Tester will take " + - "approximately 30 seconds to run all the tests. \r\n" + + "some time to run all the tests. \r\n" + "Thank you for waiting :)" + "\r\n" + "-----END NOTICE----- \r\n"); @@ -108,8 +121,11 @@ public void run () { try { + System.out.println("getting converter references...."); //get all the converters - ServiceReference[] convRefs = getConverterReferences(); + ServiceReference[] convRefs = + ConverterTesterAlgorithmUtil. + getConverterReferences(bContext); @@ -132,17 +148,32 @@ * execute the tests, and provide the results to the * report generators */ + + System.out.println("Executing tests..."); + ConverterTester2 ct = new ConverterTester2(log); - ct.execute(convRefs, - new ReportGenerator[] - {allGen, allConvGen, allErrGen, - graphGen, origGraphGen, readmeGen}, - cContext, bContext); + + if (testAllConvs) { + ct.execute(convRefs, + new ReportGenerator[] + {allGen, allConvGen, allErrGen, + graphGen, origGraphGen, readmeGen}, + cContext, bContext); + } else { + ct.execute(convRefs, + new ReportGenerator[] + {allGen, allConvGen, allErrGen, + graphGen, origGraphGen, readmeGen}, + cContext, bContext, + new ConvAndHopFilter(selectedConvName, numHops)); + } /* * report generators have now been supplied with the test * results, and their reports can now be extracted. */ + System.out.println("Returning reports..."); + //return readme report ReadMeReport readmeReport = readmeGen.getReadMe(); @@ -319,23 +350,5 @@ - private ServiceReference[] getConverterReferences() { - String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))"; - - try { - ServiceReference[] refs = bContext.getServiceReferences( - AlgorithmFactory.class.getName(), filter); - - return refs; - } catch (InvalidSyntaxException e) { - this.log.log(LogService.LOG_ERROR, "Invalid syntax '" + filter + - "' for filtering service references. Attempted to " + - "obtain all converter references.", e); - return null; - } - } - - - } \ No newline at end of file Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmFactory.java 2007-09-20 21:07:14 UTC (rev 531) @@ -1,30 +1,110 @@ package org.cishell.testing.convertertester.algorithm; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Dictionary; +import java.util.List; import org.cishell.framework.CIShellContext; import org.cishell.framework.algorithm.Algorithm; import org.cishell.framework.algorithm.AlgorithmFactory; import org.cishell.framework.data.Data; +import org.cishell.reference.service.metatype.BasicAttributeDefinition; +import org.cishell.reference.service.metatype.BasicMetaTypeProvider; +import org.cishell.reference.service.metatype.BasicObjectClassDefinition; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; import org.osgi.service.component.ComponentContext; +import org.osgi.service.metatype.AttributeDefinition; +import org.osgi.service.metatype.MetaTypeInformation; import org.osgi.service.metatype.MetaTypeProvider; +import org.osgi.service.metatype.MetaTypeService; +import org.osgi.service.metatype.ObjectClassDefinition; public class ConverterTesterAlgorithmFactory implements AlgorithmFactory { + + public static final String SELECTED_CONVERTER_PARAM_ID = "selectedConverter"; + public static final String NUM_HOPS_PARAM_ID = "numHops"; + public static final String TEST_ALL_CONVS_PARAM_ID = "testAllConvs"; private BundleContext bContext; + private MetaTypeInformation originalProvider; + private String pid; protected void activate(ComponentContext ctxt) { this.bContext = ctxt.getBundleContext();; + MetaTypeService mts = (MetaTypeService)ctxt.locateService("MTS"); + this.pid = (String) ctxt.getServiceReference().getProperty(org.osgi.framework.Constants.SERVICE_PID); + this.originalProvider = mts.getMetaTypeInformation(ctxt.getBundleContext().getBundle()); } protected void deactivate(ComponentContext ctxt) { + originalProvider = null; } public Algorithm createAlgorithm(Data[] data, Dictionary parameters, CIShellContext context) { return new ConverterTesterAlgorithm(data, parameters, context, bContext); } public MetaTypeProvider createParameters(Data[] data) { - return null; + + String[] converterNames = extractConverterNames( + ConverterTesterAlgorithmUtil. + getConverterReferences(bContext)); + + + + ObjectClassDefinition oldDefinition = originalProvider.getObjectClassDefinition(this.pid, null); + + BasicObjectClassDefinition definition; + try { + definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), oldDefinition.getIcon(16)); + } catch (IOException e) { + definition = new BasicObjectClassDefinition(oldDefinition.getID(), oldDefinition.getName(), oldDefinition.getDescription(), null); + } + + definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, + new BasicAttributeDefinition(SELECTED_CONVERTER_PARAM_ID, + "Converter To Test", + "The converter that you wish to test", + AttributeDefinition.STRING, + converterNames, + converterNames)); + + definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, + new BasicAttributeDefinition(NUM_HOPS_PARAM_ID, + "Max Test Path Length", + "What is the maximum length a test path should have to be included", + AttributeDefinition.INTEGER)); + + definition.addAttributeDefinition(ObjectClassDefinition.REQUIRED, + new BasicAttributeDefinition(TEST_ALL_CONVS_PARAM_ID, + "Test All Converters?", + "Should we test all the converters or just the one selected?", + AttributeDefinition.BOOLEAN)); + + MetaTypeProvider provider = new BasicMetaTypeProvider(definition); + return provider; } + + private String[] extractConverterNames(ServiceReference[] converterRefs) { + List converterNames = new ArrayList(); + for (int ii = 0; ii < converterRefs.length; ii++) { + ServiceReference converterRef = converterRefs[ii]; + + String converterName = removePackagePrefix( + (String) converterRef.getProperty("service.pid")); + converterNames.add(converterName); + } + + return (String[]) converterNames.toArray(new String[0]); + } + + /* + * Returns everything after the last period in the OSGi service pid. + */ + private String removePackagePrefix(String pid) { + int startIndex = pid.lastIndexOf(".") + 1; + return pid.substring(startIndex); + } } \ No newline at end of file Added: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/ConverterTesterAlgorithmUtil.java 2007-09-20 21:07:14 UTC (rev 531) @@ -0,0 +1,28 @@ +package org.cishell.testing.convertertester.algorithm; + +import org.cishell.framework.algorithm.AlgorithmFactory; +import org.cishell.framework.algorithm.AlgorithmProperty; +import org.osgi.framework.BundleContext; +import org.osgi.framework.InvalidSyntaxException; +import org.osgi.framework.ServiceReference; +import org.osgi.service.log.LogService; + +public class ConverterTesterAlgorithmUtil implements AlgorithmProperty { + public static ServiceReference[] getConverterReferences( + BundleContext bContext) { + String filter = "(&("+ALGORITHM_TYPE+"="+TYPE_CONVERTER+"))"; + + try { + ServiceReference[] refs = bContext.getServiceReferences( + AlgorithmFactory.class.getName(), filter); + + return refs; + } catch (InvalidSyntaxException e) { + System.err.println("Invalid syntax '" + filter + + "' for filtering service references. Attempted to " + + "obtain all converter references."); + e.printStackTrace(); + return null; + } + } +} Added: trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/ConvAndHopFilter.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/ConvAndHopFilter.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/src/org/cishell/testing/convertertester/algorithm/pathfilter/ConvAndHopFilter.java 2007-09-20 21:07:14 UTC (rev 531) @@ -0,0 +1,39 @@ +package org.cishell.testing.convertertester.algorithm.pathfilter; + +import java.util.ArrayList; +import java.util.List; + +import org.cishell.testing.convertertester.core.converter.graph.ConverterPath; +import org.cishell.testing.convertertester.core.tester2.pathfilter.PathFilter; + +public class ConvAndHopFilter implements PathFilter { + + private String mustHaveConvName; + private int maxNumHops; + + public ConvAndHopFilter(String mustHaveConvName, int maxNumHops) { + this.mustHaveConvName = mustHaveConvName; + this.maxNumHops = maxNumHops; + } + + public ConverterPath[] filter(ConverterPath[] testPaths) { + if (testPaths != null) { + List filteredTestPaths = new ArrayList(); + for (int ii = 0; ii < testPaths.length; ii++) { + ConverterPath testPath = testPaths[ii]; + + if (testPath.containsConverterNamed(this.mustHaveConvName) && + testPath.size() <= this.maxNumHops) { + filteredTestPaths.add(testPath); + } + } + + return (ConverterPath[]) + filteredTestPaths.toArray(new ConverterPath[0]); + + } else { + return new ConverterPath[0]; + } + } + +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/META-INF/MANIFEST.MF 2007-09-20 21:07:14 UTC (rev 531) @@ -23,9 +23,11 @@ org.cishell.testing.convertertester.core.tester2, org.cishell.testing.convertertester.core.tester2.fakelogger, org.cishell.testing.convertertester.core.tester2.graphcomparison, + org.cishell.testing.convertertester.core.tester2.pathfilter, org.cishell.testing.convertertester.core.tester2.reportgen, org.cishell.testing.convertertester.core.tester2.reportgen.allconvs, org.cishell.testing.convertertester.core.tester2.reportgen.allerrors, + org.cishell.testing.convertertester.core.tester2.reportgen.allerrors.analyzer, org.cishell.testing.convertertester.core.tester2.reportgen.alltests, org.cishell.testing.convertertester.core.tester2.reportgen.convgraph, org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis, @@ -33,4 +35,5 @@ org.cishell.testing.convertertester.core.tester2.reportgen.reports, org.cishell.testing.convertertester.core.tester2.reportgen.results, org.cishell.testing.convertertester.core.tester2.reportgen.results.converter, - org.cishell.testing.convertertester.core.tester2.reportgen.results.filepass + org.cishell.testing.convertertester.core.tester2.reportgen.results.filepass, + org.cishell.testing.convertertester.core.tester2.util Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterGraph.java 2007-09-20 21:07:14 UTC (rev 531) @@ -48,10 +48,13 @@ fileExtensionCompareConverters = new ConcurrentHashMap();//<String, ConverterPath>(); + System.out.println("Deriving data formats..."); deriveDataFormats(this.converters, this.dataFormats); + System.out.println("Associating Converters..."); associateConverters(this.converters, this.inDataToConverters, this.outDataToConverters); + System.out.println("Creating converter paths..."); createConverterPaths(this.inDataToConverters, this.fileExtensionTestConverters, this.fileExtensionCompareConverters); - + System.out.println("Done creating converter paths..."); } private Converter[] createConverters(ServiceReference[] convRefs) { @@ -82,50 +85,67 @@ Converter c = cs[i]; String inDataFormat = c.getInData(); - addValueToListAssociatedWithKey(inDataToConvs, inDataFormat, c); + addUniqueValueToListAssociatedWithKey( + inDataToConvs, inDataFormat, c); String outDataFormat = c.getOutData(); - addValueToListAssociatedWithKey(outDataToConvs, outDataFormat, c); + addUniqueValueToListAssociatedWithKey( + outDataToConvs, outDataFormat, c); } } - private void createConverterPaths(Map algorithms, Map testPaths, - Map comparePaths){ - String[] keySet = new String[algorithms.keySet().size()]; - keySet = (String[])algorithms.keySet().toArray(keySet); - for(int i = 0; i < keySet.length; i++){ - String s = keySet[i]; - if(s.startsWith("file-ext")){ + private void createConverterPaths(Map inDataToConverters, + Map fileExtToTestConverters, Map fileExtToCompareConverters){ + String[] inDataFormats = new String[inDataToConverters.keySet().size()]; + + inDataFormats = + (String[])inDataToConverters.keySet().toArray(inDataFormats); + + for(int i = 0; i < inDataFormats.length; i++){ + String inDataFormat = inDataFormats[i]; + if(inDataFormat.startsWith("file-ext")){ - + System.out.println("Creating paths for format: " + inDataFormat); ConverterPath test = new ConverterPath(this.bContext, this.log); - test.setInData(s); + test.setInData(inDataFormat); - createPaths((List)algorithms.get(s), test, s); + createPaths((List)inDataToConverters.get(inDataFormat), + test); } } } - private ConverterPath createPaths(List algorithms, ConverterPath path, String dataType){ - List cs = removeReferences(algorithms, path); + private void createPaths(List allConvsForFormat, ConverterPath currentPath) { + List nextConvs = removeReferences(allConvsForFormat, currentPath); - addCompareCycle(path); + addCompareCycle(currentPath); - if(path.getInData().equals(path.getOutData())){ - addTestCycle(path); - return path; + if(currentPath.getInData().equals(currentPath.getOutData())){ + //base case + addTestCycle(currentPath); + System.out.println("**--Path Completed--**"); + List path = currentPath.getPath(); + System.out.println("Path is..."); + for (int ii = 0; ii < path.size(); ii++) { + Converter c = (Converter) path.get(ii); + System.out.println(" " + c.getShortName()); + } + System.out.println("(End Path)"); + return; } - while(!cs.isEmpty()){ - ConverterPath p = new ConverterPath(path, this.bContext); - p.add((Converter) cs.get(0)); - cs.remove(0); - createPaths((List)this.inDataToConverters.get(p.getOutData()), p, p.getOutData()); + while(!nextConvs.isEmpty()){ + ConverterPath newPath = new ConverterPath(currentPath, this.bContext); + Converter nextConv = (Converter) nextConvs.get(0); + System.out.println("Adding " + nextConv.getShortName()); + newPath.add(nextConv); + nextConvs.remove(0); + createPaths((List)this.inDataToConverters.get(newPath.getOutData()), newPath); } - return null; + return; } private void addTestCycle(ConverterPath cp){ @@ -159,21 +179,35 @@ } } - private static List removeReferences(List al, ConverterPath cp){ + private static List removeReferences(List allConvsForFormat, + ConverterPath currentPath){ List cs; - if (al != null) { - cs = new ArrayList(al); + if (allConvsForFormat != null) { + cs = new ArrayList(allConvsForFormat); } else { cs = new ArrayList(); } + System.out.println("Current path is...."); + for (int ii = 0; ii < currentPath.size(); ii++) { + System.out.println(currentPath.get(ii).getShortName()); + } - cs.removeAll(cp.getPath()); + System.out.println("^^^^ cs prior to removing loop causing convs"); + for (int ii = 0; ii < cs.size(); ii++) { + System.out.println(((Converter) cs.get(ii)).getShortName()); + } + cs.removeAll(currentPath.getPath()); + System.out.println("^^^^ cs after removing loop causing convs"); + for (int ii = 0; ii < cs.size(); ii++) { + System.out.println(((Converter) cs.get(ii)).getShortName()); + } + //do we really want to be removing these? List forbidden = new ArrayList(); for(int i = 0; i < cs.size(); i++){ Converter c = (Converter) cs.get(i); String outData = c.getOutData(); - if(outData.startsWith("file-ext") && (!outData.equals(cp.getInData()))){ + if(outData.startsWith("file-ext") && (!outData.equals(currentPath.getInData()))){ forbidden.add(c); } @@ -496,7 +530,23 @@ m.put(key, listOfValues); } else{ - ((List)m.get(key)).add(value); + List values = (List) m.get(key); + values.add(value); } } + + private void addUniqueValueToListAssociatedWithKey(Map m, Object key, Object value) { + + if(m.get(key) == null){ + List listOfValues = new ArrayList(); + listOfValues.add(value); + m.put(key, listOfValues); + } + else{ + List values = (List) m.get(key); + if (! values.contains(value)) { + values.add(value); + } + } + } } \ No newline at end of file Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/converter/graph/ConverterPath.java 2007-09-20 21:07:14 UTC (rev 531) @@ -127,6 +127,7 @@ Converter c = (Converter) this.path.get(i); if (c.isLossy()) { + System.out.println("FOUND A LOSSY CONVERTER!"); lossiness = LOSSY; } } @@ -146,6 +147,19 @@ return this.path.size(); } + public boolean containsConverterNamed(String convName) { + for (int ii = 0; ii < this.path.size(); ii++) { + Converter conv = (Converter) this.path.get(ii); + + if (conv.getShortName().equals(convName) || + conv.getUniqueName().equals(convName)) { + return true; + } + } + + return false; + } + public String getConverterName(int index) { return (String) get(index).getUniqueName(); } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConvResultMaker.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConvResultMaker.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConvResultMaker.java 2007-09-20 21:07:14 UTC (rev 531) @@ -20,6 +20,11 @@ public class ConvResultMaker { + //must succeed at least 3 times in the file pass + private static int MINIMUM_SUCCESSES_TO_BE_TRUSTED = 3; + //must be tested by at least 2/3rds of file passes in test + private static float MINIMUM_PERCENT_FILE_PASSES_REACHED_TO_BE_TRUSTED = .8f; + public static AllConvsResult generate(AllTestsResult atr, Converter[] allConvs, ChanceAtFaultHeuristic faultHeuristic) { @@ -56,26 +61,67 @@ TestResult tr = trs[ii]; FilePassResult[] fprs = tr.getFilePassResults(); - //check if all file passes were successes - boolean trusted = true; + //determine which converters always succeeded. + + int FAILED = -1; + int NEVER_TESTED = 0; + + int[] trusted = new int[tr.getAllConverters().length]; for (int jj = 0; jj < fprs.length; jj++) { FilePassResult fpr = fprs[jj]; - if (! fpr.succeeded()) { - //not all were successes - trusted = false; - break; + + if (fpr.succeeded()) { + for (int kk = 0; kk < trusted.length; kk++) { + if (trusted[kk] != FAILED) { + trusted[kk] += 1; + } + } + } else if (fpr.failedWhileComparingGraphs()) { + for (int kk = 0; kk < trusted.length; kk++) { + trusted[kk] = FAILED; + } + } else if (fpr.failedWhileConverting()) { + Converter[] convsInvolved = fpr.getConvertersInvolved(); + for (int kk = 0; kk < convsInvolved.length; kk++) { + trusted[kk] = FAILED; + } } - } + + } - if (trusted && fprs.length > 0) { - //mark all converters involved as trusted. + Converter[] allConvs = tr.getAllConverters(); + ConverterPath testConvs = tr.getTestConverters(); + if (fprs.length > 0) { + //mark trusted converters. - ConverterPath testConvs = tr.getTestConverters(); + for (int kk = 0; kk < testConvs.size(); kk++) { - Converter conv = testConvs.get(kk); - trustedConverters.add(conv); + Converter c = testConvs.get(kk); + float percentFilePassesThisConvParticipatedIn = + trusted[kk] / (float) fprs.length; + if (trusted[kk] >= MINIMUM_SUCCESSES_TO_BE_TRUSTED && + percentFilePassesThisConvParticipatedIn >= + MINIMUM_PERCENT_FILE_PASSES_REACHED_TO_BE_TRUSTED) { + trustedConverters.add(c); + } } +// ConverterPath testConvs = tr.getAllConverters(); +// for (int kk = 0; kk < testConvs.length; kk++) { +// Converter conv = testConvs[kk]; +// if (trusted[kk] == ALWAYS_SUCCEEDED) { +// trustedConverters.add(conv); +// } +// } + +// //technically I wouldn't trust the comparison +// //converters here, but I'm adding this because +// //it makes the results easier to understand. +// ConverterPath compareConvs = tr.getComparisonConverters(); +// for (int kk = 0; kk < compareConvs.size(); kk++) { +// Converter conv = compareConvs.get(kk); +// trustedConverters.add(conv); +// } } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-09-20 21:07:14 UTC (rev 531) @@ -20,9 +20,10 @@ import org.cishell.testing.convertertester.core.tester2.graphcomparison.IdsPreservedComparer; import org.cishell.testing.convertertester.core.tester2.graphcomparison.LossyComparer; import org.cishell.testing.convertertester.core.tester2.graphcomparison.NewGraphComparer; +import org.cishell.testing.convertertester.core.tester2.pathfilter.PathFilter; import org.cishell.testing.convertertester.core.tester2.reportgen.ReportGenerator; import org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis.ChanceAtFaultHeuristic; -import org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis.WeightedFullTrustHeuristic; +import org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis.ErrorProximityHeuristic; import org.cishell.testing.convertertester.core.tester2.reportgen.results.AllConvsResult; import org.cishell.testing.convertertester.core.tester2.reportgen.results.AllTestsResult; import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; @@ -53,6 +54,15 @@ this.testRunner = new DefaultTestRunner(log); } + public void execute( + ServiceReference[] converterRefs, + ReportGenerator[] reportGenerators, + CIShellContext cContext, + BundleContext bContext) { + execute(converterRefs, reportGenerators, cContext, bContext, + new AcceptAllFilter()); + } + /** * Tests the provided converters, and passes the results of those tests to * the report generators. Report Generators are side-effected, which takes @@ -66,17 +76,20 @@ ServiceReference[] converterRefs, ReportGenerator[] reportGenerators, CIShellContext cContext, - BundleContext bContext) { + BundleContext bContext, + PathFilter testPathFilter) { //generate all the converter paths + System.out.println("Generating converter graph paths etc..."); ConverterGraph converterGraph = new ConverterGraph(converterRefs, bContext, this.log); //run the tests + System.out.println("Running actual tests..."); TestResult[] rawResults = - runAllTests(converterGraph, cContext, bContext); + runAllTests(converterGraph, testPathFilter, cContext, bContext); AllTestsResult allTestsResult = new AllTestsResult(rawResults); @@ -84,8 +97,9 @@ Converter[] allConverters = converterGraph.getAllConverters(); + System.out.println("Running conv result maker..."); ChanceAtFaultHeuristic faultHeuristic = - new WeightedFullTrustHeuristic(); + new ErrorProximityHeuristic(); AllConvsResult allConvertersResult = ConvResultMaker.generate(allTestsResult, allConverters, faultHeuristic); @@ -100,8 +114,11 @@ } } - public TestResult[] runAllTests(ConverterGraph convGraph, - CIShellContext cContext, BundleContext bContext) { + public TestResult[] runAllTests( + ConverterGraph convGraph, + PathFilter testPathFilter, + CIShellContext cContext, + BundleContext bContext) { @@ -129,6 +146,9 @@ ConverterPath[] testConvs = (ConverterPath[]) testConvList.toArray(new ConverterPath[0]); + ConverterPath[] filteredTestConvs = + testPathFilter.filter(testConvs); + ConverterPath compareConv = (ConverterPath) fileFormatToCompareConvs.get(fileFormat); @@ -136,17 +156,19 @@ * For each test converter, use that test converter and * the corresponding comparison converter to run a test. */ - - for (int kk = 0; kk < testConvs.length; kk++) { - numTestsSoFar++; - ConverterPath testConv = testConvs[kk]; - - TestResult testResult = - runATest(testConv, compareConv, cContext, bContext, - numTestsSoFar); - - if (testResult != null) { - testResults.add(testResult); + if (filteredTestConvs != null && + compareConv != null) { + for (int kk = 0; kk < filteredTestConvs.length; kk++) { + numTestsSoFar++; + ConverterPath testConv = filteredTestConvs[kk]; + + TestResult testResult = + runATest(testConv, compareConv, cContext, bContext, + numTestsSoFar); + + if (testResult != null) { + testResults.add(testResult); + } } } } @@ -167,7 +189,7 @@ //determine how we will compare the graphs - boolean isLossy = testConvs.isLossy() && compareConvs.isLossy(); + boolean isLossy = testConvs.isLossy() || compareConvs.isLossy(); boolean preserveIDs = testConvs.preservesIDs() && compareConvs.preservesIDs(); @@ -181,7 +203,8 @@ FilePassResult[] results = this.testRunner.runTest(testBasicData); //return the results of the test - return new TestResult(results, testConvs, compareConvs, numTestsSoFar); + return new TestResult(results, testConvs, compareConvs, + numTestsSoFar); } private Data[][] wrapInData(String[] testFilePaths, String format) { @@ -212,4 +235,12 @@ } } + private class AcceptAllFilter implements PathFilter { + + public ConverterPath[] filter(ConverterPath[] testPaths) { + return testPaths; + } + + } + } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/DefaultTestRunner.java 2007-09-20 21:07:14 UTC (rev 531) @@ -129,7 +129,7 @@ FakeLogCIShellContext fakeCContext = new FakeLogCIShellContext(testData.getContext()); - Converter currentConverter = converters.get(0); + Converter currentConverter = null; try { for (int ii = 0; ii < converters.size(); ii++) { //System.out.println("Going into converter " + ii); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/fakelogger/FakeLogService.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/fakelogger/FakeLogService.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/fakelogger/FakeLogService.java 2007-09-20 21:07:14 UTC (rev 531) @@ -20,7 +20,7 @@ } public void log(int level, String message) { - if (level == LOG_ERROR) { + if (level == LOG_ERROR | level == LOG_WARNING) { this.logMessages.add(new LogEntry(message)); } else { this.realLog.log(level, message); @@ -28,7 +28,7 @@ } public void log(int level, String message, Throwable exception) { - if (level == LOG_ERROR) { + if (level == LOG_ERROR | level == LOG_WARNING) { this.logMessages.add(new LogEntry(message, exception)); } else { this.realLog.log(level, message, exception); @@ -36,7 +36,7 @@ } public void log(ServiceReference sr, int level, String message) { - if (level == LOG_ERROR) { + if (level == LOG_ERROR | level == LOG_WARNING) { this.logMessages.add(new LogEntry(message)); } else { this.realLog.log(sr, level, message); @@ -45,7 +45,7 @@ public void log(ServiceReference sr, int level, String message, Throwable exception) { - if (level == LOG_ERROR) { + if (level == LOG_ERROR | level == LOG_WARNING) { this.logMessages.add(new LogEntry(message, exception)); } else { this.realLog.log(sr, level, message, exception); Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/pathfilter/PathFilter.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/pathfilter/PathFilter.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/pathfilter/PathFilter.java 2007-09-20 21:07:14 UTC (rev 531) @@ -0,0 +1,7 @@ +package org.cishell.testing.convertertester.core.tester2.pathfilter; + +import org.cishell.testing.convertertester.core.converter.graph.ConverterPath; + +public interface PathFilter { + public ConverterPath[] filter (ConverterPath[] testPaths); +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-20 21:07:14 UTC (rev 531) @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.PrintStream; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.cishell.testing.convertertester.core.tester2.reportgen.ReportGenerator; @@ -37,6 +38,7 @@ File nwbConvGraph) { ConvResult[] convResults = acr.getConvResults(); + Arrays.sort(convResults, ConvResult.COMPARE_BY_CORRECTNESS); FileOutputStream reportOutStream = null; try { @@ -111,8 +113,6 @@ //generate corresponding sub-report this.convSubGen.generate(cr); - ConvReport convReport = this.convSubGen.getConvReport(); - convReportsList.add(convReport); } } report.println(""); @@ -127,8 +127,6 @@ //generate corresponding sub-report this.convSubGen.generate(cr); - ConvReport convReport = this.convSubGen.getConvReport(); - convReportsList.add(convReport); } } @@ -142,20 +140,19 @@ report.println(" " + cr.getShortName()); this.convSubGen.generate(cr); - ConvReport convReport = this.convSubGen.getConvReport(); - convReportsList.add(convReport); } } report.println(""); -// for (int ii = 0; ii < convResults.length; ii++) { -// this.convSubGen.generate(convResults[ii]); -// ConvReport convReport = this.convSubGen.getConvReport(); -// convReportsList.add(convReport); -// } + for (int ii = 0; ii < convResults.length; ii++) { + this.convSubGen.generate(convResults[ii]); + ConvReport convReport = this.convSubGen.getConvReport(); + convReportsList.add(convReport); + } ConvReport[] convReports = (ConvReport[]) convReportsList.toArray(new ConvReport[0]); + this.allConvsReport = new AllConvsReport(reportFile, convReports, "All Converters Report"); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-09-20 21:07:14 UTC (rev 531) @@ -123,7 +123,7 @@ } this.convReport = new ConvReport(reportFile, new TestReport[0], - cr.getShortNameWithStatus()); + cr.getShortNameWithCorrectness()); report.println(""); report.flush(); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allerrors/analyzer/DefaultErrorSourceAnalyzer.java 2007-09-20 21:07:14 UTC (rev 531) @@ -114,8 +114,24 @@ normalizedCafs.add(normPC); } - return (ChanceAtFault[]) - normalizedCafs.toArray(new ChanceAtFault[0]); + ChanceAtFault[] uniqueNormalizedCafs = + removeDuplicateConverters(normalizedCafs); + + return uniqueNormalizedCafs; } } + + private ChanceAtFault[] removeDuplicateConverters(List cafs) { + List newCafs = new ArrayList(); + List newCafConvs = new ArrayList(); + for (int ii = 0; ii < cafs.size(); ii++) { + ChanceAtFault caf = (ChanceAtFault) cafs.get(ii); + if (! newCafConvs.contains(caf.getConverter())) { + newCafs.add(caf); + newCafConvs.add(caf.getConverter()); + } + } + + return (ChanceAtFault[]) newCafs.toArray(new ChanceAtFault[0]); + } } Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/ErrorProximityHeuristic.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/ErrorProximityHeuristic.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/ErrorProximityHeuristic.java 2007-09-20 21:07:14 UTC (rev 531) @@ -0,0 +1,151 @@ +package org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.cishell.testing.convertertester.core.converter.graph.Converter; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; + +public class ErrorProximityHeuristic implements ChanceAtFaultHeuristic { + + public static final float FAULT_REDUCTION_PER_DEGREE_REMOVED = .33333f; + public static final float FAULT_REDUCTION_FOR_TRUST = .5f; + + public ChanceAtFault[] determine(FilePassResult failFP, + Converter[] involvedCs, + Converter[] trustedCs) { + + List trustedCList = Arrays.asList(trustedCs); + + //assign fault scores to each converter + + Map convToFaultScore = new HashMap(); + + if (failFP.failedWhileConverting()) { + + //assign fault such that the closer a converter is to the failed + //converter, the more likely it is to be at fault + + final float startingFaultScore = 1.0f; + + float currentFaultScore = startingFaultScore; + + + for (int ii = 0; ii < involvedCs.length; ii++) { + Converter involvedC = (Converter) involvedCs[ii]; + + Float oldFaultScore = (Float) convToFaultScore.get(involvedC); + + Float newFaultScore; + if (oldFaultScore == null) { + // first occurrence of this converter + newFaultScore = new Float(currentFaultScore); + } else { + // converter occurred once before (at least) + // the same thing for now + newFaultScore = new Float(currentFaultScore); + } + + convToFaultScore.put(involvedC, newFaultScore); + + currentFaultScore /= FAULT_REDUCTION_PER_DEGREE_REMOVED; + } + } else if (failFP.failedWhileComparingGraphs()) { + //assign fault evenly across all converters + + Float faultScore = new Float(1); + + for (int ii = 0; ii < involvedCs.length; ii++) { + Converter involvedC = (Converter) involvedCs[ii]; + + Float oldFaultScore = (Float) convToFaultScore.get(involvedC); + + Float newFaultScore; + if (oldFaultScore == null) { + newFaultScore = faultScore; + } else { + // converter occurred once before (at least) + // the same thing for now + newFaultScore = faultScore; + } + + convToFaultScore.put(involvedC, newFaultScore); + } + } + + + Set convsInvolved = convToFaultScore.keySet(); + + //reduce fault score of trusted converters + + Iterator convIter1 = convsInvolved.iterator(); + while (convIter1.hasNext()) { + Converter convInvolved = (Converter) convIter1.next(); + Float convFaultScore = + (Float) convToFaultScore.get(convInvolved); + + if (trustedCList.contains(convInvolved)) { + Float newConvFaultScore = + new Float(convFaultScore.floatValue() * + FAULT_REDUCTION_FOR_TRUST); + convToFaultScore.put(convInvolved, newConvFaultScore); + } + } + + //determine total fault score + + float faultScoresTotal = 0.0f; + + Iterator convIter2 = convsInvolved.iterator(); + while (convIter2.hasNext()) { + Converter convInvolved = (Converter) convIter2.next(); + Float convFaultScore = + (Float) convToFaultScore.get(convInvolved); + + faultScoresTotal += convFaultScore.floatValue(); + } + + //normalize fault scores to total 1. + + Iterator convIter3 = convsInvolved.iterator(); + while (convIter3.hasNext()) { + Converter convInvolved = (Converter) convIter3.next(); + Float convFaultScore = + (Float) convToFaultScore.get(convInvolved); + + float normalizedFaultScore; + if (faultScoresTotal != 0.0f) { + normalizedFaultScore = + convFaultScore.floatValue() / faultScoresTotal; + } else { + normalizedFaultScore = 0.0f; + } + + Float newConvFaultScore = new Float(normalizedFaultScore); + + convToFaultScore.put(convInvolved, newConvFaultScore); + } + + //return chance each converter is at fault, based on fault scores. + + List resultCAFList = new ArrayList(); + for (int ii = 0; ii < involvedCs.length; ii++) { + Converter involvedC = involvedCs[ii]; + + Float convFaultScore = (Float) convToFaultScore.get(involvedC); + + + ChanceAtFault resultCAF = new ChanceAtFault(failFP, involvedC, + convFaultScore.floatValue()); + + resultCAFList.add(resultCAF); + } + + return (ChanceAtFault[]) resultCAFList.toArray(new ChanceAtFault[0]); + } +} Deleted: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedFullTrustHeuristic.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedFullTrustHeuristic.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedFullTrustHeuristic.java 2007-09-20 21:07:14 UTC (rev 531) @@ -1,166 +0,0 @@ -package org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.cishell.testing.convertertester.core.converter.graph.Converter; -import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; - -/** - * - * @author mwlinnem - * - * A less naive approach to assessing likelihood of fault, - * that gives higher weight to the converter that caused the error for - * failures in conversion, and increases chance at fault for converters - * involved more than once in the conversion path - */ -public class WeightedFullTrustHeuristic implements ChanceAtFaultHeuristic{ - - public static final Float TRUSTED_FAULT_SCORE = new Float(0); - public static final Float DEFAULT_FAULT_SCORE = new Float(1); - public static final Float FAILED_CONV_FAULT_SCORE = new Float(2); - - public ChanceAtFault[] determine(FilePassResult failFP, - Converter[] involvedCs, - Converter[] trustedCs) { - - List trustedCList = Arrays.asList(trustedCs); - - //eliminate converters that are trusted - - List unTrustedCs = new ArrayList(); - for (int ii = 0; ii < involvedCs.length; ii++) { - Converter c = involvedCs[ii]; - - if (! trustedCList.contains(c)) { - unTrustedCs.add(c); - } - } - - //assign fault scores to each untrusted converter - - Map convToFaultScore = new HashMap(); - - float totalFaultScore = 0.0f; - for (int ii = 0; ii < unTrustedCs.size(); ii++) { - Converter untrustedC = (Converter) unTrustedCs.get(ii); - - Float oldFaultScore = (Float) convToFaultScore.get(untrustedC); - Float newFaultScore; - if (oldFaultScore == null) { - //first occurrence of this converter - - if (! isConvThatFailed(untrustedC, failFP)) { - newFaultScore = DEFAULT_FAULT_SCORE; - } else { - newFaultScore = FAILED_CONV_FAULT_SCORE; - } - - } else { - //converter has occurred before - - newFaultScore = new Float(oldFaultScore.floatValue() + - DEFAULT_FAULT_SCORE.floatValue()); - } - - convToFaultScore.put(untrustedC, newFaultScore); - totalFaultScore += newFaultScore.floatValue(); - } - - //return chance each converter is at fault, based on fault scores. - - - List resultCAFList = new ArrayList(); - - - - - for (int ii = 0; ii < involvedCs.length; ii++) { - Converter involvedC = involvedCs[ii]; - - Float faultScore = (Float) convToFaultScore.get(involvedC); - //if there is no associated score... - if (faultScore == null) { - //this converter must have been removed because it was - //trusted, so give it the fault score for trusted converters. - faultScore = TRUSTED_FAULT_SCORE; - } - - float normalizedFaultScore; - if (totalFaultScore != 0.0f) { - normalizedFaultScore = - faultScore.floatValue() / totalFaultScore; - } else { - normalizedFaultScore = 0.0f; - } - - ChanceAtFault resultCAF = new ChanceAtFault(failFP, involvedC, - normalizedFaultScore); - - resultCAFList.add(resultCAF); - } - - return (ChanceAtFault[]) resultCAFList.toArray(new ChanceAtFault[0]); - - - - -// -// //easier to deal with as a list -// List trustedCList = Arrays.asList(trustedCs); -// -// //eliminate converters involved twice in the file pass -// -// Set uniqueInvolvedCs = new HashSet(); -// for (int ii = 0; ii < involvedCs.length; ii++) { -// uniqueInvolvedCs.add(involvedCs[ii]); -// } -// //eliminate converters that are trusted -// -// List uniqueUntrustedCs = new ArrayList(); -// Iterator iter = uniqueInvolvedCs.iterator(); -// while (iter.hasNext()) { -// Converter c = (Converter) iter.next(); -// if (! trustedCList.contains(c)) { -// //converter isn't trusted -// //add it to the list -// uniqueUntrustedCs.add(c); -// } else { -// //converter is trusted -// //do nothing -// } -// } -// -// float chanceEachAtFault = 1.0f / uniqueUntrustedCs.size(); -// -// List chanceAtFaultList = new ArrayList(); -// for (int ii = 0; ii < involvedCs.length; ii++) { -// Converter c = involvedCs[ii]; -// -// ChanceAtFault chanceAtFault = null; -// if (uniqueUntrustedCs.contains(c)) { -// chanceAtFault = -// new ChanceAtFault((FilePassFailure) failFP, c, chanceEachAtFault); -// } else { -// chanceAtFault = -// new ChanceAtFault((FilePassFailure) failFP, c, 0.0f); -// } -// -// chanceAtFaultList.add(chanceAtFault); -// } -// -// return (ChanceAtFault[]) -// chanceAtFaultList.toArray(new ChanceAtFault[0]); - } - - private boolean isConvThatFailed(Converter c, FilePassResult failFP) { - return failFP.failedWhileConverting() && - failFP.getFailedConverter() == c; - } -} Copied: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedTrustHeuristic.java (from rev 525, trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedFullTrustHeuristic.java) =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedTrustHeuristic.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/faultanalysis/WeightedTrustHeuristic.java 2007-09-20 21:07:14 UTC (rev 531) @@ -0,0 +1,170 @@ +package org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.cishell.testing.convertertester.core.converter.graph.Converter; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; + +/** + * + * @author mwlinnem + * + * A less naive approach to assessing likelihood of fault, + * that gives higher weight to the converter that caused the error for + * failures in conversion, and increases chance at fault for converters + * involved more than once in the conversion path + */ +public class WeightedTrustHeuristic implements ChanceAtFaultHeuristic{ + + public static final Float DEFAULT_FAULT_SCORE = new Float(1); + + public static final float TRUSTED_CONV_PENALTY_REDUCTION = .1f; + + public static final float FAILED_CONV_PENALTY = 3.0f; + public static final float REPEAT_PENALTY = .5f; + + public ChanceAtFault[] determine(FilePassResult failFP, + Converter[] involvedCs, + Converter[] trustedCs) { + + List trustedCList = Arrays.asList(trustedCs); + + //assign fault scores to each converter + + Map convToFaultScore = new HashMap(); + + for (int ii = 0; ii < involvedCs.length; ii++) { + Converter involvedC = (Converter) involvedCs[ii]; + + Float oldFaultScore = (Float) convToFaultScore.get(involvedC); + Float newFaultScore; + if (oldFaultScore == null) { + //first occurrence of this converter + + newFaultScore = DEFAULT_FAULT_SCORE; + if (isConvThatFailed(involvedC, failFP)) { + newFaultScore = new Float(newFaultScore.floatValue() * + FAILED_CONV_PENALTY); + } + + } else { + //converter has occurred before + + newFaultScore = new Float(oldFaultScore.floatValue() + + DEFAULT_FAULT_SCORE.floatValue() * REPEAT_PENALTY); + } + + convToFaultScore.put(involvedC, newFaultScore); + + } + + + + //reduce fault scores of trusted converters + + float faultScoresTotal = 0.0f; + + Set convs = convToFaultScore.keySet(); + Iterator convIter = convs.iterator(); + while (convIter.hasNext()) { + Converter convInvolved = (Converter) convIter.next(); + Float convFaultScore = + (Float) convToFaultScore.get(convInvolved); + + if (trustedCList.contains(convInvolved)) { + convFaultScore = new Float(convFaultScore.floatValue() * + TRUSTED_CONV_PENALTY_REDUCTION); + } + + convToFaultScore.put(convInvolved, convFaultScore); + faultScoresTotal += convFaultScore.floatValue(); + } + + List resultCAFList = new ArrayList(); + + + //return chance each converter is at fault, based on fault scores. + + for (int ii = 0; ii < involvedCs.length; ii++) { + Converter involvedC = involvedCs[ii]; + + Float faultScore = (Float) convToFaultScore.get(involvedC); + + float normalizedFaultScore; + if (faultScoresTotal != 0.0f) { + normalizedFaultScore = + faultScore.floatValue() / faultScoresTotal; + } else { + normalizedFaultScore = 0.0f; + } + + ChanceAtFault resultCAF = new ChanceAtFault(failFP, involvedC, + normalizedFaultScore); + + resultCAFList.add(resultCAF); + } + + return (ChanceAtFault[]) resultCAFList.toArray(new ChanceAtFault[0]); + + + + +// +// //easier to deal with as a list +// List trustedCList = Arrays.asList(trustedCs); +// +// //eliminate converters involved twice in the file pass +// +// Set uniqueInvolvedCs = new HashSet(); +// for (int ii = 0; ii < involvedCs.length; ii++) { +// uniqueInvolvedCs.add(involvedCs[ii]); +// } +// //eliminate converters that are trusted +// +// List uniqueUntrustedCs = new ArrayList(); +// Iterator iter = uniqueInvolvedCs.iterator(); +// while (iter.hasNext()) { +// Converter c = (Converter) iter.next(); +// if (! trustedCList.contains(c)) { +// //converter isn't trusted +// //add it to the list +// uniqueUntrustedCs.add(c); +// } else { +// //converter is trusted +// //do nothing +// } +// } +// +// float chanceEachAtFault = 1.0f / uniqueUntrustedCs.size(); +// +// List chanceAtFaultList = new ArrayList(); +// for (int ii = 0; ii < involvedCs.length; ii++) { +// Converter c = involvedCs[ii]; +// +// ChanceAtFault chanceAtFault = null; +// if (uniqueUntrustedCs.contains(c)) { +// chanceAtFault = +// new ChanceAtFault((FilePassFailure) failFP, c, chanceEachAtFault); +// } else { +// chanceAtFault = +// new ChanceAtFault((FilePassFailure) failFP, c, 0.0f); +// } +// +// chanceAtFaultList.add(chanceAtFault); +// } +// +// return (ChanceAtFault[]) +// chanceAtFaultList.toArray(new ChanceAtFault[0]); + } + + private boolean isConvThatFailed(Converter c, FilePassResult failFP) { + return failFP.failedWhileConverting() && + failFP.getFailedConverter() == c; + } +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java 2007-09-18 03:11:08 UTC (rev 530) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java 2007-09-20 21:07:14 UTC... [truncated message content] |
From: <hu...@us...> - 2007-09-18 03:11:16
|
Revision: 530 http://cishell.svn.sourceforge.net/cishell/?rev=530&view=rev Author: huangb Date: 2007-09-17 20:11:08 -0700 (Mon, 17 Sep 2007) Log Message: ----------- change the label Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties Modified: trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties =================================================================== --- trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties 2007-09-17 17:41:07 UTC (rev 529) +++ trunk/testing/org.cishell.testing.convertertester.algorithm/OSGI-INF/algorithm.properties 2007-09-18 03:11:08 UTC (rev 530) @@ -1,5 +1,5 @@ menu_path=File/Test/additions -label=Converter Tester Algorithm +label=Converter Tester description=Tests Converters in_data=null out_data=null This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |