├── .github └── ISSUE_TEMPLATE.md ├── .travis-toolchains.xml ├── .travis.sh ├── .travis.yml ├── LICENSE.md ├── README.md ├── com.mountainminds.eclemma.asm ├── .gitignore ├── .project ├── META-INF │ └── MANIFEST.MF ├── about.html ├── build.properties ├── plugin.properties └── pom.xml ├── com.mountainminds.eclemma.build ├── .project ├── pom.xml └── publish.py ├── com.mountainminds.eclemma.core.test ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── META-INF │ └── MANIFEST.MF ├── about.html ├── build.properties ├── pom.xml ├── src │ └── com │ │ └── mountainminds │ │ └── eclemma │ │ ├── core │ │ ├── EclEmmaStatusTest.java │ │ ├── JavaProjectKit.java │ │ ├── URLExecutionDataSourceTest.java │ │ └── launching │ │ │ └── JavaApplicationLauncherTest.java │ │ └── internal │ │ └── core │ │ ├── CoverageSessionTest.java │ │ ├── DefaultScopeFilterTest.java │ │ ├── ExecutionDataFilesTest.java │ │ ├── MemoryExecutionDataSourceTest.java │ │ ├── SessionManagerTest.java │ │ ├── analysis │ │ ├── AnalyzedNodesTest.java │ │ ├── BinarySignatureResolverTest.java │ │ ├── MethodLocatorTest.java │ │ ├── PackageFragmentRootAnalyzerTest.java │ │ ├── SessionAnalyzerTest.java │ │ ├── SignatureResolverTestBase.java │ │ ├── SourceSignatureResolverTest.java │ │ └── TypeTraverserTest.java │ │ └── launching │ │ ├── AdjustedLaunchConfigurationTest.java │ │ ├── AgentArgumentSupportTest.java │ │ └── ConfigurationMock.java └── testdata │ ├── bin │ └── signatureresolver.jar │ └── src │ ├── methodlocator │ └── Samples.java │ ├── signatureresolver │ └── Samples.java │ └── typetraverser │ └── Samples.java ├── com.mountainminds.eclemma.core ├── .classpath ├── .gitignore ├── .options ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── META-INF │ └── MANIFEST.MF ├── about.html ├── build.properties ├── lifecycle-mapping-metadata.xml ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── com │ └── mountainminds │ └── eclemma │ ├── core │ ├── AgentExecutionDataSource.java │ ├── CoverageTools.java │ ├── EclEmmaStatus.java │ ├── ICorePreferences.java │ ├── ICoverageSession.java │ ├── IExecutionDataSource.java │ ├── ISessionExporter.java │ ├── ISessionImporter.java │ ├── ISessionListener.java │ ├── ISessionManager.java │ ├── ScopeUtils.java │ ├── URLExecutionDataSource.java │ ├── analysis │ │ ├── IJavaCoverageListener.java │ │ └── IJavaModelCoverage.java │ └── launching │ │ ├── CoverageLauncher.java │ │ ├── EclipseLauncher.java │ │ ├── ICoverageLaunch.java │ │ ├── ICoverageLaunchConfigurationConstants.java │ │ ├── ICoverageLauncher.java │ │ └── JavaApplicationLauncher.java │ └── internal │ └── core │ ├── CoreMessages.java │ ├── CoverageSession.java │ ├── DebugOptions.java │ ├── DefaultScopeFilter.java │ ├── EclEmmaCorePlugin.java │ ├── ExecutionDataFiles.java │ ├── JavaCoverageLoader.java │ ├── MemoryExecutionDataSource.java │ ├── SessionExporter.java │ ├── SessionImporter.java │ ├── SessionManager.java │ ├── analysis │ ├── AnalyzedNodes.java │ ├── ITypeVisitor.java │ ├── JavaElementCoverageAdapterFactory.java │ ├── JavaModelCoverage.java │ ├── MethodLocator.java │ ├── PackageFragementRootAnalyzer.java │ ├── ResourceTreeWalker.java │ ├── SessionAnalyzer.java │ ├── SignatureResolver.java │ └── TypeTraverser.java │ ├── coremessages.properties │ └── launching │ ├── AdjustedLaunchConfiguration.java │ ├── AdjustedLaunchConfigurationWorkingCopy.java │ ├── AgentArgumentSupport.java │ ├── AgentServer.java │ └── CoverageLaunch.java ├── com.mountainminds.eclemma.debug.ui.compatibility ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── META-INF │ └── MANIFEST.MF ├── about.html ├── build.properties ├── pom.xml └── src │ └── org │ └── eclipse │ └── debug │ └── ui │ └── actions │ └── RelaunchLastAction.java ├── com.mountainminds.eclemma.doc ├── .gitignore ├── .project ├── META-INF │ └── MANIFEST.MF ├── about.html ├── book.css ├── build.properties ├── contexts_ui.xml ├── pages │ ├── annotations.html │ ├── changes.html │ ├── coverageproperties.html │ ├── coverageview.html │ ├── decorators.html │ ├── faq.html │ ├── images │ │ ├── annotations.png │ │ ├── coverageproperties.png │ │ ├── coverageview.png │ │ ├── coverageviewmenu.png │ │ ├── coverageviewtools.png │ │ ├── decorators.png │ │ ├── extern.gif │ │ ├── launchdialog.png │ │ └── launchtoolbar.gif │ ├── importexport.html │ ├── introduction.html │ ├── keyboard.html │ ├── launching.html │ ├── license.html │ ├── preferences.html │ ├── sessions.html │ ├── support.html │ └── userguide.html ├── plugin.properties ├── plugin.xml ├── pom.xml └── toc.xml ├── com.mountainminds.eclemma.feature ├── .gitignore ├── .project ├── about.html ├── build.properties ├── feature.properties ├── feature.xml └── pom.xml ├── com.mountainminds.eclemma.site ├── .gitignore ├── .project ├── category.xml └── pom.xml ├── com.mountainminds.eclemma.target ├── .project ├── eclemma-e3.5.target ├── eclemma-e3.6.target ├── eclemma-e3.7.target ├── eclemma-e3.8.target └── pom.xml ├── com.mountainminds.eclemma.ui ├── .classpath ├── .gitignore ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── META-INF │ └── MANIFEST.MF ├── about.html ├── about.ini ├── about.properties ├── build.properties ├── eclemma32.gif ├── icons │ └── full │ │ ├── dgm │ │ ├── greenbar.gif │ │ └── redbar.gif │ │ ├── dlcl16 │ │ ├── dump.gif │ │ ├── export.gif │ │ ├── import.gif │ │ ├── mergesessions.gif │ │ ├── relaunch.gif │ │ ├── remove.gif │ │ ├── removeall.gif │ │ ├── runcoverage.gif │ │ └── session.gif │ │ ├── elcl16 │ │ ├── collapseall.gif │ │ ├── dump.gif │ │ ├── export.gif │ │ ├── import.gif │ │ ├── java_ovr.gif │ │ ├── linked.gif │ │ ├── mergesessions.gif │ │ ├── relaunch.gif │ │ ├── remove.gif │ │ ├── removeall.gif │ │ ├── runcoverage.gif │ │ ├── session.gif │ │ ├── showpackageroots.gif │ │ ├── showpackages.gif │ │ ├── showprojects.gif │ │ └── showtypes.gif │ │ ├── etool16 │ │ ├── eclipse_launch.gif │ │ ├── java_launch.gif │ │ ├── junit_launch.gif │ │ ├── junitplugin_launch.gif │ │ ├── scala_launch.gif │ │ ├── session_export.gif │ │ ├── session_import.gif │ │ ├── swtbot_launch.gif │ │ └── testng_launch.gif │ │ ├── eview16 │ │ ├── coverage.gif │ │ └── exec.gif │ │ ├── obj16 │ │ ├── markerfull.gif │ │ ├── markerno.gif │ │ ├── markerpartial.gif │ │ └── session.gif │ │ ├── ovr16 │ │ ├── coverage00.gif │ │ ├── coverage01.gif │ │ ├── coverage02.gif │ │ ├── coverage03.gif │ │ ├── coverage04.gif │ │ ├── coverage05.gif │ │ ├── coverage06.gif │ │ └── coverage07.gif │ │ └── wizban │ │ ├── export_session.gif │ │ ├── import_session.gif │ │ └── run_coverage.gif ├── plugin.properties ├── plugin.xml ├── pom.xml └── src │ └── com │ └── mountainminds │ └── eclemma │ ├── internal │ └── ui │ │ ├── ContextHelp.java │ │ ├── EclEmmaUIPlugin.java │ │ ├── RedGreenBar.java │ │ ├── ScopeViewer.java │ │ ├── UIMessages.java │ │ ├── UIPreferences.java │ │ ├── WorkbenchAdapterFactory.java │ │ ├── actions │ │ ├── ContextualLaunchableTester.java │ │ ├── CoverageAsAction.java │ │ ├── CoverageContextualLaunchAction.java │ │ ├── CoverageHistoryAction.java │ │ ├── CoverageLastAction.java │ │ ├── CoverageToolbarAction.java │ │ └── OpenCoverageConfigurations.java │ │ ├── annotation │ │ ├── CoverageAnnotation.java │ │ ├── CoverageAnnotationImageProvider.java │ │ ├── CoverageAnnotationModel.java │ │ └── EditorTracker.java │ │ ├── coverageview │ │ ├── CellTextConverter.java │ │ ├── CopyHandler.java │ │ ├── CoverageView.java │ │ ├── CoverageViewSorter.java │ │ ├── CoveredElementsContentProvider.java │ │ ├── HideUnusedElementsHandler.java │ │ ├── LinkWithSelectionHandler.java │ │ ├── MaxTotalCache.java │ │ ├── RefreshSessionHandler.java │ │ ├── SelectCountersHandler.java │ │ ├── SelectRootElementsHandler.java │ │ ├── SelectionTracker.java │ │ └── ViewSettings.java │ │ ├── decorators │ │ └── CoverageDecorator.java │ │ ├── dialogs │ │ ├── CoveragePreferencePage.java │ │ ├── CoveragePropertyPage.java │ │ └── MergeSessionsDialog.java │ │ ├── editors │ │ ├── AbstractExecutionDataContentProvider.java │ │ ├── CoverageSessionInput.java │ │ ├── ExecutedClassesFilters.java │ │ ├── ExecutedClassesPage.java │ │ ├── ExecutionDataContent.java │ │ ├── ExecutionDataEditor.java │ │ └── SessionDataPage.java │ │ ├── handlers │ │ ├── AbstractSessionManagerHandler.java │ │ ├── DumpExecutionDataHandler.java │ │ ├── DumpExecutionDataItems.java │ │ ├── ExportSessionHandler.java │ │ ├── ImportSessionHandler.java │ │ ├── LaunchLabelProvider.java │ │ ├── MergeSessionsHandler.java │ │ ├── OpenSessionExecutionDataHandler.java │ │ ├── RelaunchSessionHandler.java │ │ ├── RemoveActiveSessionHandler.java │ │ ├── RemoveAllSessionsHandler.java │ │ ├── ResetOnDumpHandler.java │ │ ├── SelectActiveSessionHandler.java │ │ └── SelectActiveSessionsItems.java │ │ ├── launching │ │ └── NoCoverageDataHandler.java │ │ ├── uimessages.properties │ │ └── wizards │ │ ├── SessionExportPage1.java │ │ ├── SessionExportWizard.java │ │ ├── SessionImportPage1.java │ │ ├── SessionImportPage2.java │ │ ├── SessionImportWizard.java │ │ └── WidgetHistory.java │ └── ui │ └── launching │ ├── CoverageLaunchShortcut.java │ ├── CoverageTab.java │ └── CoverageTabGroup.java └── pom.xml /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | This is a issue tracker. Please use our mailing list for general questions: 2 | https://groups.google.com/forum/?fromgroups=#!forum/jacoco 3 | 4 | Also check FAQ before opening an issue: http://www.eclemma.org/faq.html 5 | 6 | 7 | ### Steps to reproduce 8 | 9 | EclEmma version: 10 | Eclipse version: 11 | Operating system: 12 | 13 | 14 | ### Expected behaviour 15 | 16 | 17 | ### Actual behaviour 18 | -------------------------------------------------------------------------------- /.travis-toolchains.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | jdk 6 | 7 | java7 8 | 1.7 9 | oracle 10 | 11 | 12 | /usr/lib/jvm/java-7-oracle 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.travis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | if [[ ${TRAVIS_PULL_REQUEST} == 'false' && ${TRAVIS_BRANCH} == 'master' ]] 6 | then 7 | mvn -V -B -e \ 8 | verify -Djdk.version=1.7 --toolchains=./.travis-toolchains.xml \ 9 | sonar:sonar -Dsonar.host.url=${SONARQUBE_URL} -Dsonar.login=${SONARQUBE_TOKEN} 10 | else 11 | mvn -V -B -e \ 12 | verify -Djdk.version=1.7 --toolchains=./.travis-toolchains.xml 13 | fi 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: oraclejdk8 3 | 4 | # Skip "install" stage: 5 | install: true 6 | 7 | # Use container-based infrastructure: 8 | sudo: false 9 | 10 | script: bash .travis.sh 11 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | 4 | Copyright (c) 2009, 2016 Mountainminds GmbH & Co. KG and Contributors 5 | 6 | The EclEmma Eclipse plug-in and all included documentation is made available by 7 | Mountainminds GmbH & Co. KG, Munich. Except indicated below, the Content is 8 | provided to you under the terms and conditions of the Eclipse Public 9 | License Version 1.0 ("EPL"). A copy of the EPL is available at 10 | [http://www.eclipse.org/legal/epl-v10.html](http://www.eclipse.org/legal/epl-v10.html). 11 | 12 | Please visit 13 | [http://www.eclemma.org/license.html](http://www.eclemma.org/license.html) 14 | for the complete license information including third party licenses and trademarks. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | EclEmma Java Code Coverage Plug-in for Eclipse 2 | ============================================== 3 | 4 | [![Build Status](https://travis-ci.org/jacoco/eclemma.svg?branch=master)](https://travis-ci.org/jacoco/eclemma) 5 | 6 | EclEmma is a free Java code coverage plug-in for 7 | [Eclipse](http://www.eclipse.org/), available under the 8 | [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html). Check 9 | [http://www.eclemma.org/](http://www.eclemma.org/) for downloads, documentation 10 | and feedback. -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.asm 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-SymbolicName: com.mountainminds.eclemma.asm 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: %providerName 7 | Bundle-Localization: plugin 8 | Export-Package: org.objectweb.asm;version=5.1, 9 | org.objectweb.asm.signature;version=5.1, 10 | org.objectweb.asm.commons;version=5.1, 11 | org.objectweb.asm.tree;version=5.1, 12 | org.objectweb.asm.tree.analysis;version=5.1, 13 | org.objectweb.asm.util;version=5.1, 14 | org.objectweb.asm.xml;version=5.1 15 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 16 | Import-Package: org.objectweb.asm;version="5.1", 17 | org.objectweb.asm.signature;version="5.1", 18 | org.objectweb.asm.tree;version="5.1" 19 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = .,\ 4 | plugin.properties,\ 5 | about.html 6 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/plugin.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Marc R. Hoffmann - initial API and implementation 10 | # 11 | #******************************************************************************* 12 | 13 | providerName = Mountainminds GmbH & Co. KG 14 | pluginName = EclEmma ASM 15 | 16 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.asm/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.asm 24 | eclipse-plugin 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-dependency-plugin 31 | 32 | 33 | unpack 34 | process-classes 35 | 36 | unpack 37 | 38 | 39 | 40 | 41 | org.ow2.asm 42 | asm-all 43 | 5.1 44 | jar 45 | false 46 | ${project.build.directory}/classes 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.build/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.build 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.build/publish.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # You can specify credentials via environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY 4 | # Or in boto config file ( see http://code.google.com/p/boto/wiki/BotoConfig ), for example in "~/.boto" as following: 5 | # [Credentials] 6 | # aws_access_key_id = {ACCESS KEY ID} 7 | # aws_secret_access_key = {SECRET ACCESS KEY} 8 | 9 | from boto.s3.connection import S3Connection 10 | import sys 11 | import os 12 | 13 | BUCKET = 'download.eclipselab.org' 14 | BASE_PATH = 'eclemma/trunk/update' 15 | 16 | def delete_previous(bucket, dry_run): 17 | for key in bucket.get_all_keys(prefix=BASE_PATH): 18 | print 'Deleting %s' % key.name 19 | if not dry_run: 20 | key.delete() 21 | 22 | def upload_current(bucket, dry_run, source_dir): 23 | # remove trailing slash if it exists 24 | if source_dir[-1:] == "/": 25 | source_dir = source_dir[0:-1] 26 | 27 | for root, dirs, files in os.walk(source_dir): 28 | dirpath = BASE_PATH + root[len(source_dir):] 29 | for f in files: 30 | print "Uploading %s/%s" % (dirpath, f) 31 | if not dry_run: 32 | key = bucket.new_key(dirpath + '/' + f) 33 | key.set_contents_from_filename(root + '/' + f) 34 | key.set_acl('public-read') 35 | 36 | basedir = os.path.abspath(os.path.dirname(__file__)) 37 | source_dir = basedir + "/../com.mountainminds.eclemma.site/target/repository" 38 | 39 | # prevent accidental execution 40 | dry_run = True 41 | if len(sys.argv) == 2 and sys.argv[1] == "-x": 42 | dry_run = False 43 | 44 | if dry_run: 45 | print "DRY RUN: specify option '-x' for actual execution" 46 | 47 | # sanity check 48 | if not os.path.isfile(source_dir + "/content.jar"): 49 | sys.exit("content.jar not found in %s" % source_dir) 50 | 51 | connection = S3Connection() 52 | bucket = connection.get_bucket(BUCKET) 53 | 54 | delete_previous(bucket, dry_run) 55 | upload_current(bucket, dry_run, source_dir) 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.core.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: EclEmma Core Tests 4 | Bundle-SymbolicName: com.mountainminds.eclemma.core.test 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: Mountainminds GmbH & Co. KG 7 | Fragment-Host: com.mountainminds.eclemma.core;bundle-version="[2.3.3,3.0.0)" 8 | Require-Bundle: org.junit;bundle-version="4.0.0", 9 | org.hamcrest.core 10 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 11 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | about.html,\ 6 | testdata/ 7 | javacSource = 1.5 8 | javacTarget = 1.5 9 | jre.compilation.profile = J2SE-1.5 10 | 11 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.core.test 24 | eclipse-test-plugin 25 | 26 | 27 | 28 | 29 | org.eclipse.tycho 30 | tycho-surefire-plugin 31 | 32 | 33 | 34 | 35 | p2-installable-unit 36 | org.eclipse.jdt.feature.group 37 | 0.0.0 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/core/EclEmmaStatusTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | import static org.junit.Assert.assertSame; 16 | 17 | import org.eclipse.core.runtime.IStatus; 18 | import org.junit.Test; 19 | 20 | /** 21 | * Tests for {@link EclEmmaStatus}. 22 | */ 23 | public class EclEmmaStatusTest { 24 | 25 | @Test 26 | public void testCode1() { 27 | EclEmmaStatus estatus = EclEmmaStatus.NO_LOCAL_AGENTJAR_ERROR; 28 | IStatus status = estatus.getStatus(); 29 | assertEquals(estatus.code, status.getCode()); 30 | } 31 | 32 | @Test 33 | public void testSeverity1() { 34 | EclEmmaStatus estatus = EclEmmaStatus.NO_LOCAL_AGENTJAR_ERROR; 35 | IStatus status = estatus.getStatus(); 36 | assertEquals(estatus.severity, status.getSeverity()); 37 | } 38 | 39 | @Test 40 | public void testMessage1() { 41 | EclEmmaStatus estatus = EclEmmaStatus.NO_LOCAL_AGENTJAR_ERROR; 42 | IStatus status = estatus.getStatus(); 43 | assertEquals("Local agent jar can not be obtained (code 5000).", 44 | status.getMessage()); 45 | } 46 | 47 | @Test 48 | public void testMessage2() { 49 | EclEmmaStatus estatus = EclEmmaStatus.UNKOWN_LAUNCH_TYPE_ERROR; 50 | IStatus status = estatus.getStatus("abcdef"); 51 | assertEquals("Unknown launch type abcdef (code 5002).", status.getMessage()); 52 | } 53 | 54 | @Test 55 | public void testThrowable1() { 56 | EclEmmaStatus estatus = EclEmmaStatus.NO_LOCAL_AGENTJAR_ERROR; 57 | Throwable t = new Exception(); 58 | IStatus status = estatus.getStatus(t); 59 | assertSame(t, status.getException()); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/internal/core/analysis/AnalyzedNodesTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import static org.junit.Assert.assertNull; 15 | import static org.junit.Assert.assertSame; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | import org.jacoco.core.analysis.IClassCoverage; 21 | import org.jacoco.core.analysis.ISourceFileCoverage; 22 | import org.jacoco.core.internal.analysis.ClassCoverageImpl; 23 | import org.jacoco.core.internal.analysis.SourceFileCoverageImpl; 24 | import org.junit.Before; 25 | import org.junit.Test; 26 | 27 | /** 28 | * Tests for {@link AnalyzedNodes}. 29 | */ 30 | public class AnalyzedNodesTest { 31 | 32 | private List classes; 33 | private List sourcefiles; 34 | 35 | @Before 36 | public void setup() { 37 | classes = new ArrayList(); 38 | sourcefiles = new ArrayList(); 39 | } 40 | 41 | @Test 42 | public void testGetClassCoverage() { 43 | final ClassCoverageImpl c = new ClassCoverageImpl("package/MyClass", 0, 44 | false); 45 | classes.add(c); 46 | 47 | final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles); 48 | 49 | assertSame(c, nodes.getClassCoverage("package/MyClass")); 50 | } 51 | 52 | @Test 53 | public void testGetClassCoverageNegative() { 54 | final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles); 55 | 56 | assertNull(nodes.getClassCoverage("somewhere/NotExist")); 57 | } 58 | 59 | @Test 60 | public void testGetSourceFileCoverage() { 61 | final SourceFileCoverageImpl c = new SourceFileCoverageImpl("Example.java", 62 | "com/example"); 63 | sourcefiles.add(c); 64 | 65 | final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles); 66 | 67 | assertSame(c, nodes.getSourceFileCoverage("com/example", "Example.java")); 68 | } 69 | 70 | @Test 71 | public void testGetSourceFileCoverageNegative() { 72 | final AnalyzedNodes nodes = new AnalyzedNodes(classes, sourcefiles); 73 | 74 | assertNull(nodes.getSourceFileCoverage("com/example", "NotExist.java")); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/internal/core/analysis/BinarySignatureResolverTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | 16 | import org.eclipse.core.runtime.Path; 17 | import org.eclipse.jdt.core.IClassFile; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | import org.junit.After; 20 | import org.junit.Before; 21 | import org.junit.Test; 22 | 23 | import com.mountainminds.eclemma.core.JavaProjectKit; 24 | 25 | /** 26 | * Test {@link SignatureResolver} based on Java binaries. 27 | */ 28 | public class BinarySignatureResolverTest extends SignatureResolverTestBase { 29 | 30 | private JavaProjectKit javaProject; 31 | 32 | @Before 33 | public void setup() throws Exception { 34 | javaProject = new JavaProjectKit(); 35 | javaProject.enableJava5(); 36 | final IPackageFragmentRoot root = javaProject.createJAR( 37 | "testdata/bin/signatureresolver.jar", "/signatureresolver.jar", 38 | new Path("/UnitTestProject/signatureresolver.jar"), null); 39 | JavaProjectKit.waitForBuild(); 40 | javaProject.assertNoErrors(); 41 | final IClassFile classFile = root.getPackageFragment("signatureresolver") 42 | .getClassFile("Samples.class"); 43 | type = classFile.getType(); 44 | createMethodIndex(); 45 | } 46 | 47 | @After 48 | public void teardown() throws Exception { 49 | javaProject.destroy(); 50 | } 51 | 52 | @Test 53 | public void testGetParameterNoArgs() { 54 | assertEquals("", SignatureResolver.getParameters("()Ljava.lang.Integer;")); 55 | } 56 | 57 | @Test 58 | public void testGetParameterWithArgs() { 59 | assertEquals("[[Ljava/util/Map$Entry;", 60 | SignatureResolver.getParameters("([[Ljava/util/Map$Entry;)I")); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/internal/core/analysis/SourceSignatureResolverTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | 16 | import org.eclipse.jdt.core.ICompilationUnit; 17 | import org.eclipse.jdt.core.IMethod; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | import org.junit.After; 20 | import org.junit.Before; 21 | import org.junit.Test; 22 | 23 | import com.mountainminds.eclemma.core.JavaProjectKit; 24 | 25 | /** 26 | * Test {@link SignatureResolver} based on Java source. 27 | */ 28 | public class SourceSignatureResolverTest extends SignatureResolverTestBase { 29 | 30 | private JavaProjectKit javaProject; 31 | 32 | @Before 33 | public void setup() throws Exception { 34 | javaProject = new JavaProjectKit(); 35 | javaProject.enableJava5(); 36 | final IPackageFragmentRoot root = javaProject.createSourceFolder("src"); 37 | final ICompilationUnit compilationUnit = javaProject.createCompilationUnit( 38 | root, "testdata/src", "signatureresolver/Samples.java"); 39 | JavaProjectKit.waitForBuild(); 40 | javaProject.assertNoErrors(); 41 | type = compilationUnit.getTypes()[0]; 42 | createMethodIndex(); 43 | } 44 | 45 | @After 46 | public void teardown() throws Exception { 47 | javaProject.destroy(); 48 | } 49 | 50 | @Test 51 | public void test_innerClassTypeVariable() throws Exception { 52 | final IMethod method = type.getType("Inner").getMethods()[0]; 53 | assertEquals(SignatureResolver.getParameters(method), 54 | "Ljava/lang/Comparable;"); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/internal/core/launching/AgentArgumentSupportTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.launching; 13 | 14 | import static org.junit.Assert.assertEquals; 15 | import static org.junit.Assert.assertTrue; 16 | 17 | import java.io.File; 18 | 19 | import org.eclipse.core.runtime.CoreException; 20 | import org.eclipse.debug.core.ILaunchConfiguration; 21 | import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; 22 | import org.junit.Before; 23 | import org.junit.Test; 24 | 25 | import com.mountainminds.eclemma.core.ICorePreferences; 26 | 27 | /** 28 | * Unit tests for {@link AgentArgumentSupport}. 29 | */ 30 | public class AgentArgumentSupportTest { 31 | 32 | private AgentArgumentSupport support; 33 | 34 | @Before 35 | public void setup() { 36 | support = new AgentArgumentSupport(ICorePreferences.DEFAULT); 37 | } 38 | 39 | @Test 40 | public void testQuote1() { 41 | assertEquals("abcdef", support.quote("abcdef")); 42 | } 43 | 44 | @Test 45 | public void testQuote2() { 46 | assertEquals("\"abc def\"", support.quote("abc def")); 47 | } 48 | 49 | @Test 50 | public void testGetAgentFile() throws CoreException { 51 | final File file = support.getAgentFile(); 52 | assertTrue(file.exists()); 53 | assertTrue(file.isFile()); 54 | } 55 | 56 | @Test 57 | public void testGetArgument() throws CoreException { 58 | final String arg = support.getArgument(12345); 59 | assertTrue(arg, arg.startsWith("-javaagent:")); 60 | assertTrue( 61 | arg, 62 | arg.endsWith("jacocoagent.jar=includes=*,excludes=,exclclassloader=sun.reflect.DelegatingClassLoader,output=tcpclient,port=12345")); 63 | } 64 | 65 | @Test 66 | public void testAddArgument() throws CoreException { 67 | ConfigurationMock mock = new ConfigurationMock(); 68 | mock.pushResult("OTHER"); 69 | final ILaunchConfiguration config = support.addArgument(12345, 70 | mock.getMock()); 71 | final String arg = config.getAttribute( 72 | IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, ""); 73 | assertTrue(arg, arg.startsWith("-javaagent:")); 74 | assertTrue(arg, arg.endsWith("OTHER")); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/src/com/mountainminds/eclemma/internal/core/launching/ConfigurationMock.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.launching; 13 | 14 | import java.lang.reflect.InvocationHandler; 15 | import java.lang.reflect.Method; 16 | import java.lang.reflect.Proxy; 17 | import java.util.Stack; 18 | 19 | import org.eclipse.debug.core.ILaunchConfiguration; 20 | 21 | /** 22 | * Mock support for {@link ILaunchConfiguration}. 23 | */ 24 | class ConfigurationMock implements InvocationHandler { 25 | 26 | private ILaunchConfiguration mock; 27 | 28 | private Stack mockResult; 29 | 30 | ConfigurationMock() { 31 | mockResult = new Stack(); 32 | mock = (ILaunchConfiguration) Proxy.newProxyInstance(getClass() 33 | .getClassLoader(), new Class[] { ILaunchConfiguration.class }, this); 34 | } 35 | 36 | ILaunchConfiguration getMock() { 37 | return mock; 38 | } 39 | 40 | void pushResult(Object value) { 41 | mockResult.push(value); 42 | } 43 | 44 | // InvocationHandler implementation 45 | 46 | public Object invoke(Object proxy, Method method, Object[] args) 47 | throws Throwable { 48 | return mockResult.pop(); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/testdata/bin/signatureresolver.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.core.test/testdata/bin/signatureresolver.jar -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/testdata/src/methodlocator/Samples.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG 3 | * This software is provided under the terms of the Eclipse Public License v1.0 4 | * See http://www.eclipse.org/legal/epl-v10.html. 5 | ******************************************************************************/ 6 | package methodlocator; 7 | 8 | import java.util.Date; 9 | 10 | /** 11 | * Collections of methods with different Signatures. 12 | */ 13 | public class Samples { 14 | 15 | /* ()V */ 16 | Samples() { 17 | } 18 | 19 | /* (Ljava/lang/String;)V */ 20 | Samples(String param) { 21 | } 22 | 23 | /* (I)V */ 24 | Samples(int param) { 25 | } 26 | 27 | /* (Ljava/lang/String;)V */ 28 | void m1(String s) { 29 | } 30 | 31 | /* (Ljava/lang/Integer;)V */ 32 | void m2(Integer i) { 33 | } 34 | 35 | /* (Ljava/lang/Number;)V */ 36 | void m2(Number n) { 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core.test/testdata/src/typetraverser/Samples.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG 3 | * This software is provided under the terms of the Eclipse Public License v1.0 4 | * See http://www.eclipse.org/legal/epl-v10.html. 5 | ******************************************************************************/ 6 | package typetraverser; 7 | 8 | /** 9 | * Test type for TypeTraverser. 10 | */ 11 | public class Samples { 12 | 13 | public static void doit() { 14 | } 15 | 16 | // Nested class with anonymous inner class 17 | 18 | static class InnerA { 19 | public void test() { 20 | new Runnable() { 21 | public void run() { 22 | doit(); 23 | } 24 | }; 25 | } 26 | } 27 | 28 | // Anonymous class with named inner class: 29 | 30 | static { 31 | new Runnable() { 32 | class InnerB { 33 | public void test() { 34 | doit(); 35 | } 36 | } 37 | 38 | public void run() { 39 | new InnerB().test(); 40 | } 41 | }.run(); 42 | } 43 | 44 | // Another anonymous class with named inner class: 45 | 46 | static { 47 | new Runnable() { 48 | class InnerC { 49 | public void test() { 50 | doit(); 51 | } 52 | } 53 | 54 | public void run() { 55 | new InnerC().test(); 56 | } 57 | }.run(); 58 | } 59 | 60 | // Member Initializer with anonymous class: 61 | 62 | public Object member1 = new Runnable() { 63 | public void run() { 64 | doit(); 65 | } 66 | }; 67 | 68 | // Method with anonymous class: 69 | 70 | public void test() { 71 | Runnable r = new Runnable() { 72 | public void run() { 73 | doit(); 74 | } 75 | }; 76 | r.run(); 77 | }; 78 | 79 | public static void main(String[] args) { 80 | 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/.options: -------------------------------------------------------------------------------- 1 | # Enable trace output for performance (time/memory) 2 | com.mountainminds.eclemma.core/debug/performance=true 3 | 4 | # Enable trace output for coverage analysis 5 | com.mountainminds.eclemma.core/debug/analysis=true -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.core 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-SymbolicName: com.mountainminds.eclemma.core; singleton:=true 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: %providerName 7 | Bundle-Localization: plugin 8 | Export-Package: com.mountainminds.eclemma.core, 9 | com.mountainminds.eclemma.core.analysis, 10 | com.mountainminds.eclemma.core.launching, 11 | com.mountainminds.eclemma.internal.core;x-internal:=true, 12 | com.mountainminds.eclemma.internal.core.analysis;x-internal:=true, 13 | com.mountainminds.eclemma.internal.core.launching;x-internal:=true 14 | Require-Bundle: org.eclipse.core.runtime, 15 | org.eclipse.debug.core, 16 | org.eclipse.jdt.core, 17 | org.eclipse.jdt.launching, 18 | org.jacoco.core;bundle-version="[0.7.7,0.7.8)", 19 | org.jacoco.agent;bundle-version="[0.7.7,0.7.8)", 20 | org.jacoco.report;bundle-version="[0.7.7,0.7.8)" 21 | Bundle-Activator: com.mountainminds.eclemma.internal.core.EclEmmaCorePlugin 22 | Bundle-ActivationPolicy: lazy 23 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 24 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | .options,\ 7 | plugin.properties,\ 8 | lifecycle-mapping-metadata.xml,\ 9 | about.html 10 | javacSource = 1.5 11 | javacTarget = 1.5 12 | jre.compilation.profile = J2SE-1.5 13 | 14 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/lifecycle-mapping-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | org.jacoco 7 | jacoco-maven-plugin 8 | [0.1,) 9 | 10 | prepare-agent 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/plugin.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Marc R. Hoffmann - initial API and implementation 10 | # 11 | #******************************************************************************* 12 | 13 | providerName = Mountainminds GmbH & Co. KG 14 | pluginName = EclEmma Core 15 | 16 | coverage = Coverage 17 | 18 | javaDelegateName=EclEmma Java 19 | junitDelegateName=EclEmma JUnit Test 20 | eclipseApplicationDelegateName=EclEmma Eclipse Application 21 | junitPluginDelegateName=EclEmma JUnit Plugin Test 22 | osgiDelegateName=EclEmma OSGi Framework 23 | testNgDelegateName=EclEmma TestNG 24 | junitRAPDelegateName=EclEmma RAP JUnit Test 25 | swtBotJunitDelegateName=EclEmma SWTBot Test 26 | scalaDelegateName=EclEmma Scala 27 | 28 | execFileContentType=JaCoCo Execution Data File -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.core 24 | eclipse-plugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/AgentExecutionDataSource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import java.io.IOException; 15 | import java.net.Socket; 16 | 17 | import org.eclipse.core.runtime.CoreException; 18 | import org.jacoco.core.data.IExecutionDataVisitor; 19 | import org.jacoco.core.data.ISessionInfoVisitor; 20 | import org.jacoco.core.runtime.RemoteControlReader; 21 | import org.jacoco.core.runtime.RemoteControlWriter; 22 | 23 | 24 | /** 25 | * {@link IExecutionDataSource} that receives execution data from a JaCoCo agent 26 | * via a TCP/IP connection. 27 | */ 28 | public class AgentExecutionDataSource implements IExecutionDataSource { 29 | 30 | private String address; 31 | private int port; 32 | private boolean reset; 33 | 34 | public AgentExecutionDataSource(final String address, final int port, 35 | final boolean reset) { 36 | this.address = address; 37 | this.port = port; 38 | this.reset = reset; 39 | } 40 | 41 | public void accept(IExecutionDataVisitor executionDataVisitor, 42 | ISessionInfoVisitor sessionInfoVisitor) throws CoreException { 43 | try { 44 | final Socket socket = new Socket(address, port); 45 | final RemoteControlWriter writer = new RemoteControlWriter( 46 | socket.getOutputStream()); 47 | final RemoteControlReader reader = new RemoteControlReader( 48 | socket.getInputStream()); 49 | reader.setExecutionDataVisitor(executionDataVisitor); 50 | reader.setSessionInfoVisitor(sessionInfoVisitor); 51 | writer.visitDumpCommand(true, reset); 52 | reader.read(); 53 | socket.close(); 54 | } catch (IOException e) { 55 | throw new CoreException(EclEmmaStatus.AGENT_CONNECT_ERROR.getStatus( 56 | address, Integer.valueOf(port), e)); 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/ICoverageSession.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.IAdaptable; 17 | import org.eclipse.debug.core.ILaunchConfiguration; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | 20 | /** 21 | * A coverage session is the result of a coverage run (or multiple merged runs) 22 | * or coverage data imported from an external source. It is an immutable 23 | * container for all data necessary to 24 | * 25 | *
    26 | *
  • provide coverage highlighting in Java editors,
  • 27 | *
  • populate the coverage view and
  • 28 | *
  • export coverage reports.
  • 29 | *
30 | * 31 | * This interface is not intended to be implemented by clients. 32 | * 33 | * @see CoverageTools#createCoverageSession(String, IClassFiles[], 34 | * org.eclipse.core.runtime.IPath[], ILaunchConfiguration) 35 | */ 36 | public interface ICoverageSession extends IAdaptable, IExecutionDataSource { 37 | 38 | /** 39 | * Returns a readable description for this coverage session. 40 | * 41 | * @return readable description 42 | */ 43 | public String getDescription(); 44 | 45 | /** 46 | * Returns the set of package fragment roots defining the scope of this 47 | * session. 48 | * 49 | * @return session scope as set of {@link IPackageFragmentRoot} 50 | */ 51 | public Set getScope(); 52 | 53 | /** 54 | * If this session was the result of a Eclipse launch this method returns the 55 | * respective launch configuration. Otherwise null is returned. 56 | * 57 | * @return launch configuration or null 58 | */ 59 | public ILaunchConfiguration getLaunchConfiguration(); 60 | 61 | } -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/IExecutionDataSource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.jacoco.core.data.IExecutionDataVisitor; 16 | import org.jacoco.core.data.ISessionInfoVisitor; 17 | 18 | /** 19 | * Common interface for all sources of execution data. 20 | */ 21 | public interface IExecutionDataSource { 22 | 23 | /** 24 | * Emits all stored execution data in the given visitors. 25 | * 26 | * @param executionDataVisitor 27 | * visitor for execution data 28 | * @param visitor 29 | * for session information 30 | */ 31 | public abstract void accept(IExecutionDataVisitor executionDataVisitor, 32 | ISessionInfoVisitor sessionInfoVisitor) throws CoreException; 33 | 34 | } -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/ISessionImporter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.core.runtime.IProgressMonitor; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | 20 | /** 21 | * API for importing sessions. This interface is not intended to be implemented 22 | * by clients. Use {@link CoverageTools#getImporter()} to get an instance. 23 | */ 24 | public interface ISessionImporter { 25 | 26 | /** 27 | * Sets the description for the imported session. 28 | * 29 | * @param description 30 | * textual description of the session 31 | */ 32 | public void setDescription(String description); 33 | 34 | /** 35 | * Sets the source for execution data. 36 | * 37 | * @param source 38 | * execution data source 39 | */ 40 | public void setExecutionDataSource(IExecutionDataSource source); 41 | 42 | /** 43 | * Sets the set of package fragment roots that should be considered for 44 | * coverage analysis. 45 | * 46 | * @param scope 47 | * scope for analysis 48 | */ 49 | public void setScope(Set scope); 50 | 51 | /** 52 | * Specifies whether the original file should be copied while importing. 53 | * Otherwise the coverage file a referenced only. 54 | * 55 | * @param copy 56 | * flag, whether the coverage file should be copied 57 | */ 58 | public void setCopy(boolean copy); 59 | 60 | /** 61 | * A call to this method triggers the actual import process. 62 | * 63 | * @param monitor 64 | * progress monitor 65 | * @throws CoreException 66 | * if something goes wrong during export 67 | */ 68 | public void importSession(IProgressMonitor monitor) throws CoreException; 69 | 70 | } 71 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/ISessionListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | /** 15 | * Callback interface for changes of the session manager. This interface is 16 | * intended to be implemented by clients that want to get notifications. 17 | * 18 | * @see ISessionManager#addSessionListener(ISessionListener) 19 | * @see ISessionManager#removeSessionListener(ISessionListener) 20 | */ 21 | public interface ISessionListener { 22 | 23 | /** 24 | * Called when a session has been added. 25 | * 26 | * @param addedSession 27 | * added session 28 | */ 29 | public void sessionAdded(ICoverageSession addedSession); 30 | 31 | /** 32 | * Called when a session has been removed. 33 | * 34 | * @param removedSession 35 | * removes session 36 | */ 37 | public void sessionRemoved(ICoverageSession removedSession); 38 | 39 | /** 40 | * Called when a new session has been activated or the last session has been 41 | * removed. In this case null is passed as a parameter. 42 | * 43 | * @param session 44 | * activated session or null 45 | */ 46 | public void sessionActivated(ICoverageSession session); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/URLExecutionDataSource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core; 13 | 14 | import java.io.BufferedInputStream; 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.net.URL; 18 | 19 | import org.eclipse.core.runtime.CoreException; 20 | import org.jacoco.core.data.ExecutionDataReader; 21 | import org.jacoco.core.data.IExecutionDataVisitor; 22 | import org.jacoco.core.data.ISessionInfoVisitor; 23 | 24 | 25 | /** 26 | * {@link IExecutionDataSource} implementation based on a *.exec file obtained 27 | * from a URL. 28 | */ 29 | public class URLExecutionDataSource implements IExecutionDataSource { 30 | 31 | private final URL url; 32 | 33 | public URLExecutionDataSource(final URL url) { 34 | this.url = url; 35 | } 36 | 37 | public void accept(IExecutionDataVisitor executionDataVisitor, 38 | ISessionInfoVisitor sessionInfoVisitor) throws CoreException { 39 | try { 40 | final InputStream in = new BufferedInputStream(url.openStream()); 41 | final ExecutionDataReader reader = new ExecutionDataReader(in); 42 | reader.setExecutionDataVisitor(executionDataVisitor); 43 | reader.setSessionInfoVisitor(sessionInfoVisitor); 44 | reader.read(); 45 | in.close(); 46 | } catch (IOException e) { 47 | throw new CoreException(EclEmmaStatus.EXEC_FILE_READ_ERROR.getStatus(url, 48 | e)); 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/analysis/IJavaCoverageListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.analysis; 13 | 14 | /** 15 | * Callback interface implemented by clients that want to be informed, when the 16 | * current Java model coverage has changes. 17 | */ 18 | public interface IJavaCoverageListener { 19 | 20 | /** 21 | * Called when the current coverage data has changed. 22 | */ 23 | public void coverageChanged(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/launching/EclipseLauncher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.launching; 13 | 14 | import java.util.Arrays; 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | 18 | import org.eclipse.core.resources.ResourcesPlugin; 19 | import org.eclipse.core.runtime.CoreException; 20 | import org.eclipse.debug.core.ILaunchConfiguration; 21 | import org.eclipse.jdt.core.IJavaModel; 22 | import org.eclipse.jdt.core.IJavaProject; 23 | import org.eclipse.jdt.core.IPackageFragmentRoot; 24 | import org.eclipse.jdt.core.JavaCore; 25 | 26 | import com.mountainminds.eclemma.core.ScopeUtils; 27 | 28 | /** 29 | * Laucher for the Eclipse runtime workbench. 30 | */ 31 | public class EclipseLauncher extends CoverageLauncher { 32 | 33 | protected static final String PLUGIN_NATURE = "org.eclipse.pde.PluginNature"; //$NON-NLS-1$ 34 | 35 | /* 36 | * The overall scope are all plug-in projects in the workspace. 37 | */ 38 | public Set getOverallScope( 39 | ILaunchConfiguration configuration) throws CoreException { 40 | final IJavaModel model = JavaCore.create(ResourcesPlugin.getWorkspace() 41 | .getRoot()); 42 | final Set result = new HashSet(); 43 | for (final IJavaProject project : model.getJavaProjects()) { 44 | if (project.getProject().hasNature(PLUGIN_NATURE)) { 45 | result.addAll(Arrays.asList(project.getPackageFragmentRoots())); 46 | } 47 | } 48 | return ScopeUtils.filterJREEntries(result); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/launching/ICoverageLaunch.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.launching; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.debug.core.ILaunch; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | 20 | /** 21 | * Extension of the {@link ILaunch} interface to keep specific information for 22 | * coverage launches. 23 | */ 24 | public interface ICoverageLaunch extends ILaunch { 25 | 26 | /** 27 | * Returns the collection of {@link IPackageFragmentRoot} considered as the 28 | * scope for this launch. 29 | * 30 | * @return package fragment roots for this launch 31 | */ 32 | public Set getScope(); 33 | 34 | /** 35 | * Requests a new for this launch resulting in a new coverage session. 36 | * 37 | * @param reset 38 | * if true execution data is reset for this launch 39 | */ 40 | public void requestDump(boolean reset) throws CoreException; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/launching/ICoverageLaunchConfigurationConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.launching; 13 | 14 | import com.mountainminds.eclemma.internal.core.EclEmmaCorePlugin; 15 | 16 | /** 17 | * Constants for coverage specific launch configuration entries. 18 | */ 19 | public interface ICoverageLaunchConfigurationConstants { 20 | 21 | /** 22 | * List of Java element ids pointing to package fragment roots that form the 23 | * scope of a coverage launch. If unspecified a default scope is calculated 24 | * based on the launch type and preferences.. 25 | */ 26 | public static final String ATTR_SCOPE_IDS = EclEmmaCorePlugin.ID 27 | + ".SCOPE_IDS"; //$NON-NLS-1$ 28 | 29 | } 30 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/launching/ICoverageLauncher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.launching; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.debug.core.ILaunchConfiguration; 18 | import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; 19 | import org.eclipse.jdt.core.IPackageFragmentRoot; 20 | 21 | /** 22 | * The launch delegate for coverage configurations. 23 | */ 24 | public interface ICoverageLauncher extends ILaunchConfigurationDelegate2 { 25 | 26 | /** 27 | * Determines all {@link IPackageFragmentRoot}s that are part of the given 28 | * launch configuration. 29 | * 30 | * @param configuration 31 | * launch configuration to determine overall scope 32 | * 33 | * @return overall scope as set of {@link IPackageFragmentRoot} elements 34 | * 35 | * @throws CoreException 36 | */ 37 | public Set getOverallScope( 38 | ILaunchConfiguration configuration) throws CoreException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/core/launching/JavaApplicationLauncher.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.core.launching; 13 | 14 | import java.util.Arrays; 15 | import java.util.Collections; 16 | import java.util.Set; 17 | 18 | import org.eclipse.core.runtime.CoreException; 19 | import org.eclipse.debug.core.ILaunchConfiguration; 20 | import org.eclipse.jdt.core.IJavaProject; 21 | import org.eclipse.jdt.core.IPackageFragmentRoot; 22 | import org.eclipse.jdt.launching.JavaRuntime; 23 | 24 | import com.mountainminds.eclemma.core.ScopeUtils; 25 | 26 | /** 27 | * Launcher for local Java applications. 28 | */ 29 | public class JavaApplicationLauncher extends CoverageLauncher { 30 | 31 | public Set getOverallScope( 32 | ILaunchConfiguration configuration) throws CoreException { 33 | final IJavaProject project = JavaRuntime.getJavaProject(configuration); 34 | if (project == null) { 35 | return Collections.emptySet(); 36 | } else { 37 | return ScopeUtils.filterJREEntries(Arrays.asList(project 38 | .getAllPackageFragmentRoots())); 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/CoreMessages.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core; 13 | 14 | import org.eclipse.osgi.util.NLS; 15 | 16 | /** 17 | * Text messages for the core plug-in. 18 | */ 19 | public class CoreMessages extends NLS { 20 | 21 | private static final String BUNDLE_NAME = "com.mountainminds.eclemma.internal.core.coremessages";//$NON-NLS-1$ 22 | 23 | public static String LaunchSessionDescription_value; 24 | 25 | public static String Launching_task; 26 | public static String AnalyzingCoverageSession_task; 27 | public static String ExportingSession_task; 28 | public static String ImportingSession_task; 29 | public static String MergingCoverageSessions_task; 30 | 31 | public static String StatusNO_LOCAL_AGENTJAR_ERROR_message; 32 | public static String StatusSESSION_LOAD_ERROR_message; 33 | public static String StatusUNKOWN_LAUNCH_TYPE_ERROR_message; 34 | public static String StatusMERGE_SESSIONS_ERROR_message; 35 | public static String StatusEXEC_FILE_CREATE_ERROR_message; 36 | public static String StatusEXEC_FILE_READ_ERROR_message; 37 | public static String StatusAGENT_CONNECT_ERROR_message; 38 | public static String StatusBUNDLE_ANALYSIS_ERROR_message; 39 | public static String StatusEXPORT_ERROR_message; 40 | public static String StatusAGENTSERVER_START_ERROR_message; 41 | public static String StatusAGENTSERVER_STOP_ERROR_message; 42 | public static String StatusEXECDATA_DUMP_ERROR_message; 43 | public static String StatusDUMP_REQUEST_ERROR_message; 44 | 45 | public static String StatusNO_COVERAGE_DATA_ERROR_message; 46 | 47 | public static String ExportFormatHTML_value; 48 | public static String ExportFormatHTMLZIP_value; 49 | public static String ExportFormatXML_value; 50 | public static String ExportFormatCSV_value; 51 | public static String ExportFormatEXEC_value; 52 | 53 | static { 54 | NLS.initializeMessages(BUNDLE_NAME, CoreMessages.class); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/CoverageSession.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core; 13 | 14 | import java.util.Collection; 15 | import java.util.Collections; 16 | import java.util.HashSet; 17 | import java.util.Set; 18 | 19 | import org.eclipse.core.runtime.CoreException; 20 | import org.eclipse.core.runtime.PlatformObject; 21 | import org.eclipse.debug.core.ILaunchConfiguration; 22 | import org.eclipse.jdt.core.IPackageFragmentRoot; 23 | import org.jacoco.core.data.IExecutionDataVisitor; 24 | import org.jacoco.core.data.ISessionInfoVisitor; 25 | 26 | import com.mountainminds.eclemma.core.ICoverageSession; 27 | import com.mountainminds.eclemma.core.IExecutionDataSource; 28 | 29 | /** 30 | * A {@link com.mountainminds.eclemma.core.ICoverageSession} implementation. 31 | */ 32 | public class CoverageSession extends PlatformObject implements ICoverageSession { 33 | 34 | private final String description; 35 | private final Set scope; 36 | private final IExecutionDataSource executionDataSource; 37 | private final ILaunchConfiguration launchconfiguration; 38 | 39 | public CoverageSession(String description, 40 | Collection scope, 41 | IExecutionDataSource executionDataSource, 42 | ILaunchConfiguration launchconfiguration) { 43 | this.description = description; 44 | this.scope = Collections.unmodifiableSet(new HashSet( 45 | scope)); 46 | this.executionDataSource = executionDataSource; 47 | this.launchconfiguration = launchconfiguration; 48 | } 49 | 50 | // ICoverageSession implementation 51 | 52 | public String getDescription() { 53 | return description; 54 | } 55 | 56 | public Set getScope() { 57 | return scope; 58 | } 59 | 60 | public ILaunchConfiguration getLaunchConfiguration() { 61 | return launchconfiguration; 62 | } 63 | 64 | public void accept(IExecutionDataVisitor executionDataVisitor, 65 | ISessionInfoVisitor sessionInfoVisitor) throws CoreException { 66 | executionDataSource.accept(executionDataVisitor, 67 | sessionInfoVisitor); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/MemoryExecutionDataSource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core; 13 | 14 | import java.io.IOException; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.jacoco.core.data.ExecutionData; 18 | import org.jacoco.core.data.ExecutionDataReader; 19 | import org.jacoco.core.data.ExecutionDataStore; 20 | import org.jacoco.core.data.IExecutionDataVisitor; 21 | import org.jacoco.core.data.ISessionInfoVisitor; 22 | import org.jacoco.core.data.SessionInfo; 23 | import org.jacoco.core.data.SessionInfoStore; 24 | 25 | import com.mountainminds.eclemma.core.IExecutionDataSource; 26 | 27 | /** 28 | * In-memory {@link IExecutionDataSource} implementation. 29 | */ 30 | public class MemoryExecutionDataSource implements IExecutionDataSource, 31 | ISessionInfoVisitor, IExecutionDataVisitor { 32 | 33 | private final SessionInfoStore sessionInfoStore; 34 | private ExecutionDataStore executionDataStore; 35 | 36 | public MemoryExecutionDataSource() { 37 | sessionInfoStore = new SessionInfoStore(); 38 | executionDataStore = new ExecutionDataStore(); 39 | } 40 | 41 | public boolean isEmpty() { 42 | return sessionInfoStore.isEmpty(); 43 | } 44 | 45 | public void accept(IExecutionDataVisitor executionDataVisitor, 46 | ISessionInfoVisitor sessionInfoVisitor) throws CoreException { 47 | sessionInfoStore.accept(sessionInfoVisitor); 48 | executionDataStore.accept(executionDataVisitor); 49 | } 50 | 51 | public void visitSessionInfo(SessionInfo info) { 52 | sessionInfoStore.visitSessionInfo(info); 53 | } 54 | 55 | public void visitClassExecution(ExecutionData data) { 56 | executionDataStore.visitClassExecution(data); 57 | } 58 | 59 | /** 60 | * Collects execution data from the given reader. 61 | * 62 | * @param reader 63 | * reader to read execution data from 64 | */ 65 | public void readFrom(ExecutionDataReader reader) throws IOException { 66 | reader.setSessionInfoVisitor(sessionInfoStore); 67 | reader.setExecutionDataVisitor(executionDataStore); 68 | reader.read(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/SessionImporter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.core.runtime.IProgressMonitor; 18 | import org.eclipse.jdt.core.IPackageFragmentRoot; 19 | 20 | import com.mountainminds.eclemma.core.IExecutionDataSource; 21 | import com.mountainminds.eclemma.core.ISessionImporter; 22 | import com.mountainminds.eclemma.core.ISessionManager; 23 | 24 | /** 25 | * Implementation of ISessionImporter. 26 | */ 27 | public class SessionImporter implements ISessionImporter { 28 | 29 | private final ISessionManager sessionManager; 30 | private final ExecutionDataFiles executionDataFiles; 31 | 32 | private String description; 33 | private IExecutionDataSource dataSource; 34 | private Set scope; 35 | private boolean copy; 36 | 37 | public SessionImporter(ISessionManager sessionManager, 38 | ExecutionDataFiles executionDataFiles) { 39 | this.sessionManager = sessionManager; 40 | this.executionDataFiles = executionDataFiles; 41 | } 42 | 43 | public void setDescription(String description) { 44 | this.description = description; 45 | } 46 | 47 | public void setExecutionDataSource(final IExecutionDataSource source) { 48 | this.dataSource = source; 49 | } 50 | 51 | public void setScope(Set scope) { 52 | this.scope = scope; 53 | } 54 | 55 | public void setCopy(boolean copy) { 56 | this.copy = copy; 57 | } 58 | 59 | public void importSession(IProgressMonitor monitor) throws CoreException { 60 | monitor.beginTask(CoreMessages.ImportingSession_task, 2); 61 | final IExecutionDataSource source; 62 | if (this.copy) { 63 | source = this.executionDataFiles.newFile(dataSource); 64 | } else { 65 | source = dataSource; 66 | } 67 | monitor.worked(1); 68 | final CoverageSession session = new CoverageSession(description, scope, 69 | source, null); 70 | sessionManager.addSession(session, true, null); 71 | monitor.done(); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/analysis/AnalyzedNodes.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import java.util.Collection; 15 | import java.util.Collections; 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | import org.jacoco.core.analysis.IClassCoverage; 20 | import org.jacoco.core.analysis.ISourceFileCoverage; 21 | 22 | /** 23 | * Internally used container for {@link IClassCoverage} and 24 | * {@link ISourceFileCoverage} nodes. 25 | */ 26 | final class AnalyzedNodes { 27 | 28 | static final AnalyzedNodes EMPTY = new AnalyzedNodes( 29 | Collections. emptySet(), 30 | Collections. emptySet()); 31 | 32 | private final Map classmap; 33 | private final Map sourcemap; 34 | 35 | AnalyzedNodes(final Collection classes, 36 | final Collection sourcefiles) { 37 | this.classmap = new HashMap(); 38 | for (final IClassCoverage c : classes) { 39 | classmap.put(c.getName(), c); 40 | } 41 | this.sourcemap = new HashMap(); 42 | for (final ISourceFileCoverage s : sourcefiles) { 43 | final String key = sourceKey(s.getPackageName(), s.getName()); 44 | sourcemap.put(key, s); 45 | } 46 | } 47 | 48 | IClassCoverage getClassCoverage(final String vmname) { 49 | return classmap.get(vmname); 50 | } 51 | 52 | ISourceFileCoverage getSourceFileCoverage(final String vmpackagename, 53 | final String filename) { 54 | return sourcemap.get(sourceKey(vmpackagename, filename)); 55 | } 56 | 57 | private String sourceKey(final String vmpackagename, final String filename) { 58 | return vmpackagename + '/' + filename; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/analysis/ITypeVisitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import org.eclipse.jdt.core.IClassFile; 15 | import org.eclipse.jdt.core.ICompilationUnit; 16 | import org.eclipse.jdt.core.IType; 17 | import org.eclipse.jdt.core.JavaModelException; 18 | 19 | /** 20 | * Callback used by {@link TypeTraverser} to report traversed types. 21 | */ 22 | public interface ITypeVisitor { 23 | 24 | /** 25 | * Called for every type. 26 | * 27 | * @param type 28 | * Java model handle 29 | * @param binaryname 30 | * VM name of the type (e.g. java/util/Map$Entry) 31 | */ 32 | public void visit(IType type, String binaryname); 33 | 34 | /** 35 | * Called for every compilation unit. 36 | * 37 | * @param unit 38 | * Java model handle 39 | */ 40 | public void visit(ICompilationUnit unit) throws JavaModelException; 41 | 42 | /** 43 | * Called for every class file. 44 | * 45 | * @param unit 46 | * Java model handle 47 | */ 48 | public void visit(IClassFile classfile) throws JavaModelException; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/analysis/JavaElementCoverageAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.analysis; 13 | 14 | import org.eclipse.core.resources.IResource; 15 | import org.eclipse.core.runtime.IAdapterFactory; 16 | import org.eclipse.jdt.core.IJavaElement; 17 | import org.jacoco.core.analysis.ICoverageNode; 18 | import org.jacoco.core.analysis.ISourceNode; 19 | 20 | import com.mountainminds.eclemma.core.CoverageTools; 21 | import com.mountainminds.eclemma.core.analysis.IJavaModelCoverage; 22 | 23 | /** 24 | * This factory adapts IResource and IJavaElement objects to the corresponding 25 | * coverage information of the current session. The factory is hooked into the 26 | * workbench through the extension point 27 | * org.eclipse.core.runtime.adapters. 28 | */ 29 | public class JavaElementCoverageAdapterFactory implements IAdapterFactory { 30 | 31 | public Object getAdapter(Object object, 32 | @SuppressWarnings("rawtypes") Class adapterType) { 33 | // if the object is a IResource find the corresponding IJavaElement 34 | if (object instanceof IResource) { 35 | object = ((IResource) object).getAdapter(IJavaElement.class); 36 | if (object == null) { 37 | return null; 38 | } 39 | } 40 | // then find the coverage information from the current session 41 | IJavaModelCoverage mc = CoverageTools.getJavaModelCoverage(); 42 | if (mc == null) { 43 | return null; 44 | } else { 45 | ICoverageNode coverage = mc.getCoverageFor((IJavaElement) object); 46 | if (adapterType.isInstance(coverage)) { 47 | return coverage; 48 | } else { 49 | return null; 50 | } 51 | } 52 | } 53 | 54 | public Class[] getAdapterList() { 55 | return new Class[] { ICoverageNode.class, ISourceNode.class }; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/coremessages.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Marc R. Hoffmann - initial API and implementation 10 | # 11 | #******************************************************************************* 12 | 13 | # English messages for the core plug-in. 14 | 15 | LaunchSessionDescription_value={0} ({1,date,medium} {1,time,medium}) 16 | 17 | Launching_task=Launching {0} 18 | AnalyzingCoverageSession_task=Analyzing coverage session {0} 19 | ExportingSession_task=Exporting coverage session {0} 20 | ImportingSession_task=Importing coverage session 21 | MergingCoverageSessions_task=Merging coverage sessions 22 | 23 | StatusNO_LOCAL_AGENTJAR_ERROR_message=Local agent jar can not be obtained (code {0}). 24 | StatusSESSION_LOAD_ERROR_message=Error while loading coverage session (code {0}). 25 | StatusUNKOWN_LAUNCH_TYPE_ERROR_message=Unknown launch type {1} (code {0}). 26 | StatusMERGE_SESSIONS_ERROR_message=Error while merging coverage sessions (code {0}). 27 | StatusEXEC_FILE_CREATE_ERROR_message=Execution data file can not be created (code {0}). 28 | StatusEXEC_FILE_READ_ERROR_message=Error while reading execution data file {1} (code {0}). 29 | StatusAGENT_CONNECT_ERROR_message=Error while connecting to JaCoCo agent at address {1} on port {2} (code {0}). 30 | StatusBUNDLE_ANALYSIS_ERROR_message=Error while analyzing package fragment root {1} at {2} (code {0}). 31 | StatusEXPORT_ERROR_message=Error while exporting coverage session (code {0}). 32 | StatusAGENTSERVER_START_ERROR_message=Error while starting the agent server (code {0}). 33 | StatusAGENTSERVER_STOP_ERROR_message=Error while stopping the agent server (code {0}). 34 | StatusEXECDATA_DUMP_ERROR_message=Error while dumping coverage data (code {0}). 35 | StatusDUMP_REQUEST_ERROR_message=Error while requesting an execution data dump (code {0}). 36 | 37 | StatusNO_COVERAGE_DATA_ERROR_message=No coverage has been collected during coverage launch (code {0}). 38 | 39 | ExportFormatHTML_value=HTML report 40 | ExportFormatHTMLZIP_value=HTML report packed into a ZIP file 41 | ExportFormatXML_value=XML file 42 | ExportFormatCSV_value=CSV file 43 | ExportFormatEXEC_value=JaCoCo execution data file -------------------------------------------------------------------------------- /com.mountainminds.eclemma.core/src/com/mountainminds/eclemma/internal/core/launching/CoverageLaunch.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.core.launching; 13 | 14 | import java.util.Set; 15 | 16 | import org.eclipse.core.runtime.CoreException; 17 | import org.eclipse.debug.core.ILaunchConfiguration; 18 | import org.eclipse.debug.core.Launch; 19 | import org.eclipse.jdt.core.IPackageFragmentRoot; 20 | 21 | import com.mountainminds.eclemma.core.CoverageTools; 22 | import com.mountainminds.eclemma.core.launching.ICoverageLaunch; 23 | import com.mountainminds.eclemma.internal.core.EclEmmaCorePlugin; 24 | 25 | /** 26 | * Implementation of {@link ICoverageLaunch}. 27 | */ 28 | public class CoverageLaunch extends Launch implements ICoverageLaunch { 29 | 30 | private final Set scope; 31 | private final AgentServer agentServer; 32 | 33 | public CoverageLaunch(ILaunchConfiguration launchConfiguration, 34 | Set scope) { 35 | super(launchConfiguration, CoverageTools.LAUNCH_MODE, null); 36 | this.scope = scope; 37 | final EclEmmaCorePlugin plugin = EclEmmaCorePlugin.getInstance(); 38 | this.agentServer = new AgentServer(this, plugin.getSessionManager(), 39 | plugin.getExecutionDataFiles(), plugin.getPreferences()); 40 | } 41 | 42 | public AgentServer getAgentServer() { 43 | return agentServer; 44 | } 45 | 46 | // ICoverageLaunch interface 47 | 48 | public Set getScope() { 49 | return scope; 50 | } 51 | 52 | public void requestDump(boolean reset) throws CoreException { 53 | agentServer.requestDump(reset); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.debug.ui.compatibility 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: EclEmma debug.ui API fix 4 | Bundle-SymbolicName: com.mountainminds.eclemma.debug.ui.compatibility;singleton:=true 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: Mountainminds GmbH & Co. KG 7 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 8 | Export-Package: org.eclipse.debug.ui.actions 9 | Require-Bundle: org.eclipse.debug.ui, 10 | org.eclipse.core.runtime, 11 | org.eclipse.ui 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 |

30 | The user documentation contains example code taken from the Apache Jakarta 31 | Commons project, provided under the terms and conditions of the 32 | Apache License Version 2.0. A copy of this license is available at 33 | http://jakarta.apache.org/commons/license.html. 34 |

35 | 36 | 37 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | about.html 6 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.debug.ui.compatibility 24 | eclipse-plugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.debug.ui.compatibility/src/org/eclipse/debug/ui/actions/RelaunchLastAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package org.eclipse.debug.ui.actions; 13 | 14 | /** 15 | * This class is an org.eclipse.debug.ui API since Eclipse 3.8. For previous 16 | * versions this bridge is provided. 17 | */ 18 | @SuppressWarnings("restriction") 19 | public abstract class RelaunchLastAction extends 20 | org.eclipse.debug.internal.ui.actions.RelaunchLastAction { 21 | } 22 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.doc 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.ManifestBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.SchemaBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.pde.PluginNature 21 | 22 | 23 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-SymbolicName: com.mountainminds.eclemma.doc; singleton:=true 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: %providerName 7 | Bundle-Localization: plugin 8 | Require-Bundle: org.eclipse.help 9 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 |

30 | The user documentation contains example code taken from the Apache Jakarta 31 | Commons project, provided under the terms and conditions of the 32 | Apache License Version 2.0. A copy of this license is available at 33 | http://jakarta.apache.org/commons/license.html. 34 |

35 | 36 | 37 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/book.css: -------------------------------------------------------------------------------- 1 | @import "../PRODUCT_PLUGIN/book.css"; a.extern { background-image:url(pages/images/extern.gif); background-repeat:no-repeat; background-position:left center; padding-left:15px; } -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | plugin.xml,\ 3 | book.css,\ 4 | pages/,\ 5 | toc.xml,\ 6 | plugin.properties,\ 7 | about.html,\ 8 | contexts_ui.xml 9 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/contexts_ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | This view allows drilling-down coverage data along the Java element hierarchy. 7 | 8 | 9 | 10 | 11 | Shows all coverage counters for the selected Java element. 12 | 13 | 14 | 15 | Adjust the behaviour of the code coverage functionality. 16 | 17 | 18 | 19 | Launches this application type in coverage mode. 20 | 21 | 22 | 23 | This tab specifies the scope of the coverage analysis. 24 | 25 | 26 | 27 | Dump execution data from a running coverage launch. 28 | 29 | 30 | 31 | 32 | Select the coverage session that should be displayed. 33 | 34 | 35 | 36 | Merge selected coverage sessions into a single session. 37 | 38 | 39 | 40 | Export a code coverage session as HTML report or EMMA data file. 41 | 42 | 43 | 44 | Import code coverage data for analysis within the IDE. 45 | 46 | 47 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/coverageproperties.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Coverage Properties 8 | 9 | 10 | 11 | 12 |

Coverage Properties

13 | 14 |

15 | For each Java element (Java project, source folder, package, type or method) 16 | EclEmma provides a Coverage property page summarizing all coverage 17 | counters: 18 |

19 | 20 |

21 | Coverage Properties 22 |

23 | 24 |

25 | The Properties dialog can be activated from the context menu of for 26 | example the Package Explorer or Coverage view. The figures are 27 | only available if there is a active coverage 28 | session, e.g. after a coverage launch. 29 |

30 | 31 | 32 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/decorators.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Coverage Decorators 8 | 9 | 10 | 11 | 12 |

Coverage Decorators

13 | 14 |

15 | Note: This is an optional feature not enabled by default. 16 |

17 | 18 |

19 | The Eclipse workbench has the concept of so called decorators which 20 | add graphical and textual information to elements shown in the workbench 21 | views. EclEmma provides coverage decorators for the currently active 22 | coverage session: A little green/red bar on the 23 | elements' icons and a percentage value next to the names. 24 |

25 | 26 |

27 | Coverage Decorators 28 |

29 | 30 |

31 | The percentage shown is calculated based upon the instruction counters. 32 | Coverage decorators are only visible if there is an active 33 | coverage session and only shown for elements 34 | containing executable code, therefore e.g. not for abstract methods. 35 |

36 | 37 |

38 | This optional feature can be enabled in the Eclipse 39 | preferences dialog: 40 |

41 | 42 |
    43 |
  • Open the preferences dialog from WindowPreferences...
  • 44 |
  • Navigate to page GeneralAppearanceLabel Decorators
  • 45 |
  • Select Java Code Coverage and press OK
  • 46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/annotations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/annotations.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/coverageproperties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/coverageproperties.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/coverageview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/coverageview.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/coverageviewmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/coverageviewmenu.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/coverageviewtools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/coverageviewtools.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/decorators.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/decorators.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/extern.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/extern.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/launchdialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/launchdialog.png -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/images/launchtoolbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.doc/pages/images/launchtoolbar.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/sessions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Managing Coverage Sessions 8 | 9 | 10 | 11 | 12 |

Managing Coverage Sessions

13 | 14 |

15 | A coverage session is the code coverage information of particular 16 | program run. It contains the list of considered Java classes along with the 17 | recorded coverage details. 18 |

19 | 20 |

Session Lifecycle

21 | 22 |

23 | A coverage session is automatically created at the end of each 24 | coverage launch or whenever an intermediate 25 | execution data has been trigger by the user. Alternatively, sessions can be 26 | imported from external launches. The 27 | coverage view allows removing sessions. 28 |

29 | 30 |

31 | All coverage sessions are deleted when the workbench is closed. 32 |

33 | 34 |

The Active Session

35 | 36 |

37 | Even if there can be multiple coverage sessions, only one session can be the 38 | active coverage session. The active session can be selected from a 39 | drop-down list in the coverage view and defines 40 | the input of this view as well as the 41 | Java source highlighting. 42 |

43 | 44 |

Merging Sessions

45 | 46 |

47 | If the overall test set consists of multiple test launches, they will result in 48 | multiple different coverage session. For analysis it may make sense to combine 49 | these sessions to a single session. If there is more than one session the 50 | coverage view provides the Merge Sessions 51 | command. This command allows selecting a subset from the existing sessions 52 | and combining it to a single coverage session. 53 |

54 | 55 | 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/support.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Support 8 | 9 | 10 | 11 |

Support and Updates

12 | 13 |

14 | The official home page of EclEmma is 15 | www.eclemma.org. 16 | Please visit this site to 17 |

18 | 19 |
    20 |
  • download the latest version,
  • 21 |
  • get user support,
  • 22 |
  • report bugs,
  • 23 |
  • request new features and
  • 24 |
  • find developer information.
  • 25 |
26 | 27 |

28 | The quality of EclEmma strongly depends on your feedback! Please get in 29 | contact if you 30 | encounter a problem with EclEmma that has not been reported before or you miss 31 | functionality that is not yet on the feature request list. Thanks. 32 |

33 | 34 | 35 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pages/userguide.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | User Guide 8 | 9 | 10 | 11 | 12 |

User Guide

13 | 14 |

15 | EclEmma records which parts of your Java code are executed during a particular 16 | program launch. Therefore coverage analysis always involves two steps: 17 |

18 | 19 |
    20 |
  1. Run the program
  2. 21 |
  3. Analyze coverage data
  4. 22 |
23 | 24 |

25 | For reproducible results the launched programs are typically automated tests 26 | like JUnit tests. 27 |

28 | 29 |

30 | Running a coverage analysis is as simple as 31 | pressing a single button like the existing Run and Debug 32 | buttons. The coverage results are automatically summarized in the 33 | Coverage view and highlighted in the 34 | Java editors. 35 |

36 | 37 | 38 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/plugin.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # This software is provided under the terms of the Eclipse Public License v1.0 4 | # See http://www.eclipse.org/legal/epl-v10.html. 5 | # 6 | #******************************************************************************* 7 | 8 | providerName = Mountainminds GmbH & Co. KG 9 | pluginName = EclEmma Documentation 10 | 11 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 9 | 10 | 12 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.doc 24 | eclipse-plugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.doc/toc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.feature 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.pde.FeatureBuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.pde.FeatureNature 16 | 17 | 18 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | feature.properties,\ 3 | about.html 4 | 5 | 6 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/feature.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # This software is provided under the terms of the Eclipse Public License v1.0 4 | # See http://www.eclipse.org/legal/epl-v10.html. 5 | # 6 | #******************************************************************************* 7 | 8 | providerName = Mountainminds GmbH & Co. KG 9 | featureName = EclEmma Java Code Coverage 10 | 11 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.feature/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.feature 24 | eclipse-feature 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.site/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.site/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.site 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.site/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EclEmma is a free Java code coverage tool for Eclipse, available under the Eclipse Public License. It is based on the JaCoCo library and brings code coverage analysis directly into the Eclipse workbench. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.site/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | EclEmma 24 | eclipse-repository 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.target 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/eclemma-e3.5.target: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/eclemma-e3.6.target: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/eclemma-e3.7.target: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/eclemma-e3.8.target: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.target/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.target 24 | pom 25 | 26 | 27 | 28 | 29 | org.codehaus.mojo 30 | build-helper-maven-plugin 31 | 32 | 33 | attach-artifacts 34 | package 35 | 36 | attach-artifact 37 | 38 | 39 | 40 | 41 | eclemma-e3.5.target 42 | target 43 | eclemma-e3.5 44 | 45 | 46 | eclemma-e3.6.target 47 | target 48 | eclemma-e3.6 49 | 50 | 51 | eclemma-e3.7.target 52 | target 53 | eclemma-e3.7 54 | 55 | 56 | eclemma-e3.8.target 57 | target 58 | eclemma-e3.8 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /target 3 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.mountainminds.eclemma.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: %pluginName 4 | Bundle-SymbolicName: com.mountainminds.eclemma.ui; singleton:=true 5 | Bundle-Version: 2.3.4.qualifier 6 | Bundle-Vendor: %providerName 7 | Bundle-Localization: plugin 8 | Require-Bundle: com.mountainminds.eclemma.core, 9 | org.jacoco.core;bundle-version="[0.7.7,0.7.8)", 10 | org.eclipse.core.expressions, 11 | org.eclipse.core.runtime, 12 | org.eclipse.debug.ui, 13 | org.eclipse.jdt.core, 14 | org.eclipse.jdt.ui, 15 | org.eclipse.jface.text, 16 | org.eclipse.ui, 17 | org.eclipse.ui.forms, 18 | org.eclipse.ui.ide, 19 | org.eclipse.ui.workbench.texteditor, 20 | com.mountainminds.eclemma.debug.ui.compatibility 21 | Bundle-Activator: com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin 22 | Export-Package: com.mountainminds.eclemma.internal.ui;x-internal:=true, 23 | com.mountainminds.eclemma.internal.ui.actions;x-internal:=true, 24 | com.mountainminds.eclemma.internal.ui.annotation;x-internal:=true, 25 | com.mountainminds.eclemma.internal.ui.coverageview;x-internal:=true, 26 | com.mountainminds.eclemma.internal.ui.decorators;x-internal:=true, 27 | com.mountainminds.eclemma.internal.ui.dialogs;x-internal:=true, 28 | com.mountainminds.eclemma.internal.ui.launching;x-internal:=true, 29 | com.mountainminds.eclemma.internal.ui.wizards;x-internal:=true, 30 | com.mountainminds.eclemma.ui.launching 31 | Bundle-ActivationPolicy: lazy 32 | Bundle-RequiredExecutionEnvironment: J2SE-1.5 33 | 34 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | About 5 | 6 | 7 | 8 |

About This Content

9 | 10 |

11 | EclEmma is a free Java code coverage tool for Eclipse implemented by Marc R. 12 | Hoffmann et al. Check http://www.eclemma.org/ 13 | for updates, documentation and support. 14 |

15 | 16 |

License

17 | 18 |

19 | Copyright © 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 20 |

21 | 22 |

23 | All rights reserved. This program and the accompanying materials are made 24 | available under the terms of the Eclipse Public License v1.0 which accompanies 25 | this distribution. A copy of the EPL is available at 26 | http://www.eclipse.org/legal/epl-v10.html. 27 |

28 | 29 | 30 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/about.ini: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Marc R. Hoffmann - initial API and implementation 10 | # 11 | #******************************************************************************* 12 | 13 | aboutText=%aboutText 14 | featureImage=eclemma32.gif 15 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/about.properties: -------------------------------------------------------------------------------- 1 | #******************************************************************************* 2 | # Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | # All rights reserved. This program and the accompanying materials 4 | # are made available under the terms of the Eclipse Public License v1.0 5 | # which accompanies this distribution, and is available at 6 | # http://www.eclipse.org/legal/epl-v10.html 7 | # 8 | # Contributors: 9 | # Marc R. Hoffmann - initial API and implementation 10 | # 11 | #******************************************************************************* 12 | 13 | aboutText=EclEmma {featureVersion}\n\ 14 | \n\ 15 | Free Java code coverage for Eclipse implemented by Marc R. Hoffmann at al.,\n\ 16 | distributed under the terms of the Eclipse Public License 1.0\n\ 17 | \n\ 18 | Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors\n\ 19 | \n\ 20 | Check http://www.eclemma.org/ for updates, documentation and support. 21 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | icons/,\ 7 | plugin.properties,\ 8 | about.html,\ 9 | about.ini,\ 10 | about.properties,\ 11 | eclemma32.gif 12 | javacSource = 1.5 13 | javacTarget = 1.5 14 | jre.compilation.profile = J2SE-1.5 15 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/eclemma32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/eclemma32.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dgm/greenbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dgm/greenbar.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dgm/redbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dgm/redbar.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/dump.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/dump.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/export.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/export.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/import.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/import.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/mergesessions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/mergesessions.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/relaunch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/relaunch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/remove.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/remove.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/removeall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/removeall.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/runcoverage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/runcoverage.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/dlcl16/session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/dlcl16/session.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/collapseall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/collapseall.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/dump.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/dump.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/export.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/export.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/import.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/import.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/java_ovr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/java_ovr.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/linked.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/linked.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/mergesessions.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/mergesessions.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/relaunch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/relaunch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/remove.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/remove.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/removeall.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/removeall.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/runcoverage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/runcoverage.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/session.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/showpackageroots.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/showpackageroots.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/showpackages.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/showpackages.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/showprojects.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/showprojects.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/elcl16/showtypes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/elcl16/showtypes.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/eclipse_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/eclipse_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/java_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/java_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/junit_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/junit_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/junitplugin_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/junitplugin_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/scala_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/scala_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/session_export.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/session_export.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/session_import.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/session_import.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/swtbot_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/swtbot_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/etool16/testng_launch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/etool16/testng_launch.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/eview16/coverage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/eview16/coverage.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/eview16/exec.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/eview16/exec.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/obj16/markerfull.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/obj16/markerfull.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/obj16/markerno.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/obj16/markerno.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/obj16/markerpartial.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/obj16/markerpartial.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/obj16/session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/obj16/session.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage00.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage00.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage01.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage02.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage03.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage03.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage04.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage05.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage05.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage06.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage06.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/ovr16/coverage07.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/ovr16/coverage07.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/wizban/export_session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/wizban/export_session.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/wizban/import_session.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/wizban/import_session.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/icons/full/wizban/run_coverage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jacoco/eclemma/797c5a0068df8c2e42cf1bec279db30acba7083b/com.mountainminds.eclemma.ui/icons/full/wizban/run_coverage.gif -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 4.0.0 15 | 16 | 17 | com.mountainminds.eclemma 18 | com.mountainminds.eclemma.build 19 | 2.3.4-SNAPSHOT 20 | ../com.mountainminds.eclemma.build 21 | 22 | 23 | com.mountainminds.eclemma.ui 24 | eclipse-plugin 25 | 26 | 27 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/ContextHelp.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui; 13 | 14 | import org.eclipse.swt.widgets.Control; 15 | import org.eclipse.ui.PlatformUI; 16 | 17 | /** 18 | * Constants and utility methods for context help. 19 | */ 20 | public final class ContextHelp { 21 | 22 | private static final String PREFIX = EclEmmaUIPlugin.ID + "."; //$NON-NLS-1$ 23 | 24 | public static final String COVERAGE_VIEW = PREFIX + "coverage_view_context"; //$NON-NLS-1$ 25 | 26 | public static final String COVERAGE_PROPERTIES = PREFIX 27 | + "coverage_properties_context"; //$NON-NLS-1$ 28 | 29 | public static final String COVERAGE_PREFERENCES = PREFIX 30 | + "coverage_preferences_context"; //$NON-NLS-1$ 31 | 32 | public static final String COVERAGE_LAUNCH = PREFIX 33 | + "coverage_launch_context"; //$NON-NLS-1$ 34 | 35 | public static final String COVERAGE_LAUNCH_TAB = PREFIX 36 | + "coverage_launch_tab_context"; //$NON-NLS-1$ 37 | 38 | public static final String DUMP_EXECUTION_DATA = PREFIX 39 | + "dump_execution_data"; //$NON-NLS-1$ 40 | 41 | public static final String SELECT_ACTIVE_SESSION = PREFIX 42 | + "select_active_session_context"; //$NON-NLS-1$ 43 | 44 | public static final String MERGE_SESSIONS = PREFIX + "merge_sessions_context"; //$NON-NLS-1$ 45 | 46 | public static final String SESSION_EXPORT = PREFIX + "session_export_context"; //$NON-NLS-1$ 47 | 48 | public static final String SESSION_IMPORT = PREFIX + "session_import_context"; //$NON-NLS-1$ 49 | 50 | /** 51 | * Assigns the given context help id to a SWT control. 52 | * 53 | * @param control 54 | * control for this help context 55 | * @param id 56 | * context help id 57 | */ 58 | public static void setHelp(Control control, String id) { 59 | PlatformUI.getWorkbench().getHelpSystem().setHelp(control, id); 60 | } 61 | 62 | private ContextHelp() { 63 | // no instances 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/RedGreenBar.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui; 13 | 14 | import java.text.DecimalFormat; 15 | 16 | import org.eclipse.swt.widgets.Event; 17 | import org.jacoco.core.analysis.ICounter; 18 | 19 | /** 20 | * Utility methods to draw red/green bars into table cells. 21 | */ 22 | public final class RedGreenBar { 23 | 24 | private static final int BORDER_LEFT = 2; 25 | private static final int BORDER_RIGHT = 10; 26 | private static final int BORDER_TOP = 3; 27 | private static final int BORDER_BOTTOM = 4; 28 | 29 | private static final String MAX_PERCENTAGE_STRING = new DecimalFormat( 30 | UIMessages.CoverageView_columnCoverageValue).format(1.0); 31 | 32 | private RedGreenBar() { 33 | } 34 | 35 | public static void draw(Event event, int columnWith, ICounter counter) { 36 | draw(event, columnWith, counter, counter.getTotalCount()); 37 | } 38 | 39 | public static void draw(Event event, int columnWith, ICounter counter, 40 | int maxTotal) { 41 | if (maxTotal == 0) { 42 | return; 43 | } 44 | final int maxWidth = getMaxWidth(event, columnWith); 45 | final int redLength = maxWidth * counter.getMissedCount() / maxTotal; 46 | bar(event, EclEmmaUIPlugin.DGM_REDBAR, 0, redLength); 47 | final int greenLength = maxWidth * counter.getCoveredCount() / maxTotal; 48 | bar(event, EclEmmaUIPlugin.DGM_GREENBAR, redLength, greenLength); 49 | } 50 | 51 | private static void bar(Event event, String image, int xOffset, int width) { 52 | final int height = event.getBounds().height - BORDER_TOP - BORDER_BOTTOM; 53 | event.gc.drawImage(EclEmmaUIPlugin.getImage(image), 0, 0, 1, 10, event.x 54 | + xOffset + BORDER_LEFT, event.y + BORDER_TOP, width, height); 55 | } 56 | 57 | private static int getMaxWidth(Event event, int columnWith) { 58 | final int textWidth = event.gc.textExtent(MAX_PERCENTAGE_STRING).x; 59 | final int max = columnWith - BORDER_LEFT - BORDER_RIGHT - textWidth; 60 | return Math.max(0, max); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/WorkbenchAdapterFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui; 13 | 14 | import org.eclipse.core.runtime.IAdapterFactory; 15 | import org.eclipse.jface.resource.ImageDescriptor; 16 | import org.eclipse.ui.model.IWorkbenchAdapter; 17 | 18 | import com.mountainminds.eclemma.core.ICoverageSession; 19 | 20 | /** 21 | * Factory for IWorkbenchAdapters for coverage model elements. 22 | */ 23 | public class WorkbenchAdapterFactory implements IAdapterFactory { 24 | 25 | private static final IWorkbenchAdapter SESSIONADAPTER = new IWorkbenchAdapter() { 26 | 27 | public ImageDescriptor getImageDescriptor(Object object) { 28 | return EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.OBJ_SESSION); 29 | } 30 | 31 | public String getLabel(Object o) { 32 | return ((ICoverageSession) o).getDescription(); 33 | } 34 | 35 | public Object[] getChildren(Object o) { 36 | return new Object[0]; 37 | } 38 | 39 | public Object getParent(Object o) { 40 | return null; 41 | } 42 | 43 | }; 44 | 45 | public Object getAdapter(Object adaptableObject, 46 | @SuppressWarnings("rawtypes") Class adapterType) { 47 | if (adaptableObject instanceof ICoverageSession) { 48 | return SESSIONADAPTER; 49 | } 50 | return null; 51 | } 52 | 53 | @SuppressWarnings("rawtypes") 54 | public Class[] getAdapterList() { 55 | return new Class[] { IWorkbenchAdapter.class }; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/CoverageAsAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.LaunchShortcutsAction; 15 | 16 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 17 | 18 | /** 19 | * Action implementation for "Coverage as" menu. 20 | */ 21 | public class CoverageAsAction extends LaunchShortcutsAction { 22 | 23 | public CoverageAsAction() { 24 | super(EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/CoverageContextualLaunchAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.ContextualLaunchAction; 15 | 16 | import com.mountainminds.eclemma.core.CoverageTools; 17 | 18 | /** 19 | * An action delegate for the "Coverage As" context menu entry. 20 | */ 21 | public class CoverageContextualLaunchAction extends ContextualLaunchAction { 22 | 23 | public CoverageContextualLaunchAction() { 24 | super(CoverageTools.LAUNCH_MODE); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/CoverageHistoryAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction; 15 | 16 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 17 | 18 | /** 19 | * History pull-down menu for recent coverage launches. 20 | */ 21 | public class CoverageHistoryAction extends AbstractLaunchHistoryAction { 22 | 23 | public CoverageHistoryAction() { 24 | super(EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/CoverageLastAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.RelaunchLastAction; 15 | 16 | import com.mountainminds.eclemma.core.CoverageTools; 17 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 18 | import com.mountainminds.eclemma.internal.ui.UIMessages; 19 | 20 | /** 21 | * Action to re-launch the last launch in coverage mode. 22 | */ 23 | public class CoverageLastAction extends RelaunchLastAction { 24 | 25 | @Override 26 | public String getMode() { 27 | return CoverageTools.LAUNCH_MODE; 28 | } 29 | 30 | @Override 31 | public String getLaunchGroupId() { 32 | return EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP; 33 | } 34 | 35 | @Override 36 | protected String getText() { 37 | return UIMessages.CoverageLastAction_label; 38 | } 39 | 40 | @Override 41 | protected String getTooltipText() { 42 | return UIMessages.CoverageLastAction_label; 43 | } 44 | 45 | @Override 46 | protected String getDescription() { 47 | return UIMessages.CoverageLastAction_label; 48 | } 49 | 50 | @Override 51 | protected String getCommandId() { 52 | return "com.mountainminds.eclemma.ui.commands.CoverageLast"; //$NON-NLS-1$ 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/CoverageToolbarAction.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction; 15 | 16 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 17 | 18 | /** 19 | * Action for the coverage mode in the toolbar. 20 | */ 21 | public class CoverageToolbarAction extends AbstractLaunchToolbarAction { 22 | 23 | public CoverageToolbarAction() { 24 | super(EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/actions/OpenCoverageConfigurations.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.actions; 13 | 14 | import org.eclipse.debug.ui.actions.OpenLaunchDialogAction; 15 | 16 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 17 | 18 | /** 19 | * Action to open the coverage launch configuration. 20 | */ 21 | public class OpenCoverageConfigurations extends OpenLaunchDialogAction { 22 | 23 | public OpenCoverageConfigurations() { 24 | super(EclEmmaUIPlugin.ID_COVERAGE_LAUNCH_GROUP); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/annotation/CoverageAnnotationImageProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.annotation; 13 | 14 | import org.eclipse.jface.resource.ImageDescriptor; 15 | import org.eclipse.jface.text.source.Annotation; 16 | import org.eclipse.swt.graphics.Image; 17 | import org.eclipse.ui.texteditor.IAnnotationImageProvider; 18 | import org.jacoco.core.analysis.ICounter; 19 | 20 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 21 | 22 | /** 23 | * The annotation image is calculated dynamically as it depends on the branch 24 | * coverage status. 25 | */ 26 | public class CoverageAnnotationImageProvider implements 27 | IAnnotationImageProvider { 28 | 29 | public String getImageDescriptorId(Annotation annotation) { 30 | if (annotation instanceof CoverageAnnotation) { 31 | final ICounter branches = ((CoverageAnnotation) annotation).getLine() 32 | .getBranchCounter(); 33 | switch (branches.getStatus()) { 34 | case ICounter.FULLY_COVERED: 35 | return EclEmmaUIPlugin.OBJ_MARKERFULL; 36 | case ICounter.PARTLY_COVERED: 37 | return EclEmmaUIPlugin.OBJ_MARKERPARTIAL; 38 | case ICounter.NOT_COVERED: 39 | return EclEmmaUIPlugin.OBJ_MARKERNO; 40 | } 41 | } 42 | return null; 43 | } 44 | 45 | public ImageDescriptor getImageDescriptor(String imageDescritporId) { 46 | return EclEmmaUIPlugin.getImageDescriptor(imageDescritporId); 47 | } 48 | 49 | public Image getManagedImage(Annotation annotation) { 50 | // we don't manage images ourself 51 | return null; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/CoveredElementsContentProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import org.eclipse.ui.model.WorkbenchContentProvider; 15 | 16 | import com.mountainminds.eclemma.core.analysis.IJavaModelCoverage; 17 | 18 | /** 19 | * Specialized workbench content provider that selects entry elements depending 20 | * on the view setting (projects, package roots, packages or types). 21 | */ 22 | class CoveredElementsContentProvider extends WorkbenchContentProvider { 23 | 24 | private final ViewSettings settings; 25 | 26 | public CoveredElementsContentProvider(ViewSettings settings) { 27 | this.settings = settings; 28 | } 29 | 30 | public Object[] getElements(Object element) { 31 | IJavaModelCoverage coverage = (IJavaModelCoverage) element; 32 | if (coverage == IJavaModelCoverage.LOADING) { 33 | return new Object[] { CoverageView.LOADING_ELEMENT }; 34 | } 35 | if (coverage != null) { 36 | switch (settings.getRootType()) { 37 | case GROUP: 38 | return coverage.getProjects(); 39 | case BUNDLE: 40 | return coverage.getPackageFragmentRoots(); 41 | case PACKAGE: 42 | return coverage.getPackageFragments(); 43 | case CLASS: 44 | return coverage.getTypes(); 45 | } 46 | } 47 | return new Object[0]; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/HideUnusedElementsHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import java.util.Map; 15 | 16 | import org.eclipse.core.commands.AbstractHandler; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.ui.commands.IElementUpdater; 20 | import org.eclipse.ui.menus.UIElement; 21 | 22 | /** 23 | * Handler to toggle hide unused types in the coverage tree. 24 | */ 25 | class HideUnusedElementsHandler extends AbstractHandler implements 26 | IElementUpdater { 27 | 28 | public static final String ID = "com.mountainminds.eclemma.ui.hideUnusedElements"; //$NON-NLS-1$ 29 | 30 | private final ViewSettings settings; 31 | private final CoverageView view; 32 | 33 | public HideUnusedElementsHandler(ViewSettings settings, CoverageView view) { 34 | this.settings = settings; 35 | this.view = view; 36 | } 37 | 38 | public Object execute(ExecutionEvent event) throws ExecutionException { 39 | settings.setHideUnusedElements(!settings.getHideUnusedElements()); 40 | view.refreshViewer(); 41 | return null; 42 | } 43 | 44 | public void updateElement(UIElement element, 45 | @SuppressWarnings("rawtypes") Map parameters) { 46 | element.setChecked(settings.getHideUnusedElements()); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/LinkWithSelectionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * Brock Janiczak - link with selection option (SF #1774547) 11 | * 12 | ******************************************************************************/ 13 | package com.mountainminds.eclemma.internal.ui.coverageview; 14 | 15 | import java.util.Map; 16 | 17 | import org.eclipse.core.commands.AbstractHandler; 18 | import org.eclipse.core.commands.ExecutionEvent; 19 | import org.eclipse.core.commands.ExecutionException; 20 | import org.eclipse.ui.commands.IElementUpdater; 21 | import org.eclipse.ui.menus.UIElement; 22 | 23 | /** 24 | * Handle to toggle linking of the coverage view's selection with the current 25 | * selection in the workbench. 26 | */ 27 | class LinkWithSelectionHandler extends AbstractHandler implements 28 | IElementUpdater { 29 | 30 | public static final String ID = "com.mountainminds.eclemma.ui.linkWithSelection"; //$NON-NLS-1$ 31 | 32 | private final ViewSettings settings; 33 | private final SelectionTracker tracker; 34 | 35 | LinkWithSelectionHandler(ViewSettings settings, SelectionTracker tracker) { 36 | this.settings = settings; 37 | this.tracker = tracker; 38 | } 39 | 40 | public Object execute(ExecutionEvent event) throws ExecutionException { 41 | final boolean flag = !settings.isLinked(); 42 | settings.setLinked(flag); 43 | tracker.setEnabled(flag); 44 | return null; 45 | } 46 | 47 | public void updateElement(UIElement element, 48 | @SuppressWarnings("rawtypes") Map parameters) { 49 | element.setChecked(settings.isLinked()); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/MaxTotalCache.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import java.util.HashMap; 15 | import java.util.Map; 16 | 17 | import org.eclipse.jdt.core.IJavaElement; 18 | import org.eclipse.jface.viewers.ITreeContentProvider; 19 | import org.eclipse.ui.model.WorkbenchContentProvider; 20 | import org.jacoco.core.analysis.ICoverageNode; 21 | 22 | import com.mountainminds.eclemma.core.CoverageTools; 23 | 24 | /** 25 | * Internal cache to calculate and keep the maximum total amount within a group. 26 | */ 27 | class MaxTotalCache { 28 | 29 | private final ViewSettings settings; 30 | private final ITreeContentProvider contentProvider; 31 | 32 | private Map maxTotals; 33 | 34 | MaxTotalCache(ViewSettings settings) { 35 | this.settings = settings; 36 | this.contentProvider = new WorkbenchContentProvider(); 37 | this.maxTotals = new HashMap(); 38 | } 39 | 40 | int getMaxTotal(Object element) { 41 | final IJavaElement parent = ((IJavaElement) element).getParent(); 42 | Integer max = maxTotals.get(parent); 43 | if (max == null) { 44 | max = Integer.valueOf(calculateMaxTotal(parent)); 45 | maxTotals.put(parent, max); 46 | } 47 | return max.intValue(); 48 | } 49 | 50 | private int calculateMaxTotal(IJavaElement parent) { 51 | int max = 0; 52 | for (Object sibling : contentProvider.getChildren(parent)) { 53 | final ICoverageNode coverage = CoverageTools.getCoverageInfo(sibling); 54 | if (coverage != null) { 55 | max = Math.max(max, coverage.getCounter(settings.getCounters()) 56 | .getTotalCount()); 57 | } 58 | } 59 | return max; 60 | } 61 | 62 | void reset() { 63 | maxTotals.clear(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/RefreshSessionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.core.commands.ExecutionException; 16 | 17 | import com.mountainminds.eclemma.core.ISessionManager; 18 | import com.mountainminds.eclemma.internal.ui.handlers.AbstractSessionManagerHandler; 19 | 20 | /** 21 | * This handler reloads the active coverage session. 22 | */ 23 | class RefreshSessionHandler extends AbstractSessionManagerHandler { 24 | 25 | public RefreshSessionHandler(ISessionManager sessionManager) { 26 | super(sessionManager); 27 | } 28 | 29 | public boolean isEnabled() { 30 | return sessionManager.getActiveSession() != null; 31 | } 32 | 33 | public Object execute(ExecutionEvent event) throws ExecutionException { 34 | sessionManager.refreshActiveSession(); 35 | return null; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/SelectCountersHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import java.util.Map; 15 | 16 | import org.eclipse.core.commands.AbstractHandler; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.ui.commands.IElementUpdater; 20 | import org.eclipse.ui.menus.UIElement; 21 | import org.jacoco.core.analysis.ICoverageNode.CounterEntity; 22 | 23 | /** 24 | * Handler to selects the counter entities shown in the coverage tree. 25 | */ 26 | class SelectCountersHandler extends AbstractHandler implements IElementUpdater { 27 | 28 | public static final String ID = "com.mountainminds.eclemma.ui.selectCounters"; //$NON-NLS-1$ 29 | 30 | private static final String TYPE_PARAMETER = "type"; //$NON-NLS-1$ 31 | 32 | private final ViewSettings settings; 33 | private final CoverageView view; 34 | 35 | public SelectCountersHandler(ViewSettings settings, CoverageView view) { 36 | this.settings = settings; 37 | this.view = view; 38 | } 39 | 40 | public Object execute(ExecutionEvent event) throws ExecutionException { 41 | final CounterEntity type = getType(event.getParameters()); 42 | settings.setCounters(type); 43 | view.refreshViewer(); 44 | return null; 45 | } 46 | 47 | public void updateElement(UIElement element, 48 | @SuppressWarnings("rawtypes") Map parameters) { 49 | final CounterEntity type = getType(parameters); 50 | element.setChecked(settings.getCounters().equals(type)); 51 | } 52 | 53 | private CounterEntity getType(Map parameters) { 54 | return CounterEntity.valueOf((String) parameters.get(TYPE_PARAMETER)); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/coverageview/SelectRootElementsHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.coverageview; 13 | 14 | import java.util.Map; 15 | 16 | import org.eclipse.core.commands.AbstractHandler; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.ui.commands.IElementUpdater; 20 | import org.eclipse.ui.menus.UIElement; 21 | import org.jacoco.core.analysis.ICoverageNode.ElementType; 22 | 23 | /** 24 | * Handler to selects the root elements shown in the coverage tree. 25 | */ 26 | class SelectRootElementsHandler extends AbstractHandler implements 27 | IElementUpdater { 28 | 29 | public static final String ID = "com.mountainminds.eclemma.ui.selectRootElements"; //$NON-NLS-1$ 30 | 31 | private static final String TYPE_PARAMETER = "type"; //$NON-NLS-1$ 32 | 33 | private final ViewSettings settings; 34 | private final CoverageView view; 35 | 36 | public SelectRootElementsHandler(ViewSettings settings, CoverageView view) { 37 | this.settings = settings; 38 | this.view = view; 39 | } 40 | 41 | public Object execute(ExecutionEvent event) throws ExecutionException { 42 | final ElementType type = getType(event.getParameters()); 43 | settings.setRootType(type); 44 | view.refreshViewer(); 45 | return null; 46 | } 47 | 48 | public void updateElement(UIElement element, 49 | @SuppressWarnings("rawtypes") Map parameters) { 50 | final ElementType type = getType(parameters); 51 | element.setChecked(settings.getRootType().equals(type)); 52 | } 53 | 54 | private ElementType getType(Map parameters) { 55 | return ElementType.valueOf((String) parameters.get(TYPE_PARAMETER)); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/editors/AbstractExecutionDataContentProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.editors; 13 | 14 | import org.eclipse.jface.viewers.IStructuredContentProvider; 15 | import org.eclipse.jface.viewers.Viewer; 16 | import org.eclipse.ui.IPropertyListener; 17 | 18 | /** 19 | * Base class for content providers for {@link ExecutionDataContent}. It handles 20 | * the viewer update. 21 | */ 22 | abstract class AbstractExecutionDataContentProvider implements 23 | IStructuredContentProvider, IPropertyListener { 24 | 25 | private Viewer viewer; 26 | 27 | public final Object[] getElements(Object inputElement) { 28 | final ExecutionDataContent content = (ExecutionDataContent) inputElement; 29 | return getElements(content); 30 | } 31 | 32 | public final void inputChanged(Viewer viewer, Object oldInput, Object newInput) { 33 | this.viewer = viewer; 34 | if (oldInput != null) { 35 | ((ExecutionDataContent) oldInput).removePropertyListener(this); 36 | } 37 | if (newInput != null) { 38 | ((ExecutionDataContent) newInput).addPropertyListener(this); 39 | } 40 | } 41 | 42 | public final void dispose() { 43 | } 44 | 45 | public final void propertyChanged(Object source, int propId) { 46 | viewer.refresh(); 47 | } 48 | 49 | protected abstract Object[] getElements(ExecutionDataContent content); 50 | 51 | } -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/editors/CoverageSessionInput.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.editors; 13 | 14 | import org.eclipse.core.runtime.PlatformObject; 15 | import org.eclipse.jface.resource.ImageDescriptor; 16 | import org.eclipse.ui.IEditorInput; 17 | import org.eclipse.ui.IPersistableElement; 18 | 19 | import com.mountainminds.eclemma.core.ICoverageSession; 20 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 21 | 22 | /** 23 | * Wrapper for a {@link ICoverageSession} instance to serve as an 24 | * {@link IEditorInput}. 25 | */ 26 | public class CoverageSessionInput extends PlatformObject implements 27 | IEditorInput { 28 | 29 | private final ICoverageSession session; 30 | 31 | public CoverageSessionInput(ICoverageSession session) { 32 | this.session = session; 33 | } 34 | 35 | public ICoverageSession getSession() { 36 | return session; 37 | } 38 | 39 | public ImageDescriptor getImageDescriptor() { 40 | return EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.EVIEW_EXEC); 41 | } 42 | 43 | public String getName() { 44 | return session.getDescription(); 45 | } 46 | 47 | public String getToolTipText() { 48 | return session.getDescription(); 49 | } 50 | 51 | @Override 52 | public int hashCode() { 53 | return session.hashCode(); 54 | } 55 | 56 | @Override 57 | public boolean equals(Object obj) { 58 | if (!(obj instanceof CoverageSessionInput)) { 59 | return false; 60 | } 61 | final CoverageSessionInput other = (CoverageSessionInput) obj; 62 | return session.equals(other.session); 63 | } 64 | 65 | public boolean exists() { 66 | return false; 67 | } 68 | 69 | public IPersistableElement getPersistable() { 70 | return null; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/editors/ExecutionDataEditor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Brock Janiczak - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.editors; 13 | 14 | import org.eclipse.core.runtime.IProgressMonitor; 15 | import org.eclipse.ui.IEditorInput; 16 | import org.eclipse.ui.PartInitException; 17 | import org.eclipse.ui.forms.editor.FormEditor; 18 | 19 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 20 | 21 | /** 22 | * Editor implementation for JaCoCo execution data files. 23 | */ 24 | public class ExecutionDataEditor extends FormEditor { 25 | 26 | public static final String ID = "com.mountainminds.eclemma.ui.editors.executiondata"; //$NON-NLS-1$ 27 | 28 | private final ExecutionDataContent content = new ExecutionDataContent(); 29 | 30 | @Override 31 | protected void addPages() { 32 | try { 33 | addPage(new ExecutedClassesPage(this, content)); 34 | addPage(new SessionDataPage(this, content)); 35 | } catch (PartInitException e) { 36 | EclEmmaUIPlugin.log(e); 37 | } 38 | } 39 | 40 | @Override 41 | protected void setInput(IEditorInput input) { 42 | super.setInput(input); 43 | setPartName(getEditorInput().getName()); 44 | content.load(getEditorInput()); 45 | firePropertyChange(PROP_INPUT); 46 | } 47 | 48 | @Override 49 | public boolean isSaveAsAllowed() { 50 | return false; 51 | } 52 | 53 | @Override 54 | public void doSave(IProgressMonitor monitor) { 55 | } 56 | 57 | @Override 58 | public void doSaveAs() { 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/AbstractSessionManagerHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.commands.AbstractHandler; 15 | import org.eclipse.core.commands.HandlerEvent; 16 | 17 | import com.mountainminds.eclemma.core.ICoverageSession; 18 | import com.mountainminds.eclemma.core.ISessionListener; 19 | import com.mountainminds.eclemma.core.ISessionManager; 20 | 21 | /** 22 | * Abstract base for handlers that need a {@link ISessionManager} instance. 23 | */ 24 | public abstract class AbstractSessionManagerHandler extends AbstractHandler 25 | implements ISessionListener { 26 | 27 | protected final ISessionManager sessionManager; 28 | 29 | protected AbstractSessionManagerHandler(ISessionManager sessionManager) { 30 | this.sessionManager = sessionManager; 31 | sessionManager.addSessionListener(this); 32 | } 33 | 34 | @Override 35 | public void dispose() { 36 | sessionManager.removeSessionListener(this); 37 | } 38 | 39 | public void sessionAdded(ICoverageSession addedSession) { 40 | fireEnabledChanged(); 41 | } 42 | 43 | public void sessionRemoved(ICoverageSession removedSession) { 44 | fireEnabledChanged(); 45 | } 46 | 47 | public void sessionActivated(ICoverageSession session) { 48 | fireEnabledChanged(); 49 | } 50 | 51 | private void fireEnabledChanged() { 52 | fireHandlerChanged(new HandlerEvent(this, true, false)); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/DumpExecutionDataItems.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.jface.action.ContributionItem; 15 | import org.eclipse.swt.SWT; 16 | import org.eclipse.swt.events.SelectionAdapter; 17 | import org.eclipse.swt.events.SelectionEvent; 18 | import org.eclipse.swt.widgets.Menu; 19 | import org.eclipse.swt.widgets.MenuItem; 20 | 21 | import com.mountainminds.eclemma.core.CoverageTools; 22 | import com.mountainminds.eclemma.core.launching.ICoverageLaunch; 23 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 24 | 25 | /** 26 | * Dynamically created menu items for selecting the coverage launch to dump 27 | * execution data from. 28 | */ 29 | public class DumpExecutionDataItems extends ContributionItem { 30 | 31 | @Override 32 | public boolean isDynamic() { 33 | return true; 34 | } 35 | 36 | @Override 37 | public void fill(final Menu menu, int index) { 38 | for (ICoverageLaunch launch : CoverageTools.getRunningCoverageLaunches()) { 39 | createItem(menu, index++, launch); 40 | } 41 | } 42 | 43 | private void createItem(final Menu parent, final int index, 44 | final ICoverageLaunch launch) { 45 | final MenuItem item = new MenuItem(parent, SWT.PUSH, index); 46 | item.setImage(EclEmmaUIPlugin.getImage(EclEmmaUIPlugin.ELCL_DUMP)); 47 | item.setText(LaunchLabelProvider.getLaunchText(launch)); 48 | item.addSelectionListener(new SelectionAdapter() { 49 | @Override 50 | public void widgetSelected(SelectionEvent e) { 51 | DumpExecutionDataHandler.requestDump(launch); 52 | } 53 | }); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/ExportSessionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import java.util.Collections; 15 | 16 | import org.eclipse.core.commands.Command; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.core.commands.common.CommandException; 20 | import org.eclipse.ui.IWorkbenchCommandConstants; 21 | import org.eclipse.ui.commands.ICommandService; 22 | import org.eclipse.ui.handlers.HandlerUtil; 23 | 24 | import com.mountainminds.eclemma.core.CoverageTools; 25 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 26 | import com.mountainminds.eclemma.internal.ui.wizards.SessionExportWizard; 27 | 28 | /** 29 | * Handler to export a JaCoCo coverage session. 30 | * 31 | * Unlike the default handler for the export command, this implementation does 32 | * not overwrite menu icons and labels. 33 | */ 34 | public class ExportSessionHandler extends AbstractSessionManagerHandler { 35 | 36 | public ExportSessionHandler() { 37 | super(CoverageTools.getSessionManager()); 38 | } 39 | 40 | @Override 41 | public boolean isEnabled() { 42 | return !sessionManager.getSessions().isEmpty(); 43 | } 44 | 45 | public Object execute(ExecutionEvent event) throws ExecutionException { 46 | final ICommandService cs = (ICommandService) HandlerUtil.getActiveSite( 47 | event).getService(ICommandService.class); 48 | final Command command = cs 49 | .getCommand(IWorkbenchCommandConstants.FILE_EXPORT); 50 | final ExecutionEvent importEvent = new ExecutionEvent(command, 51 | Collections.singletonMap("exportWizardId", SessionExportWizard.ID), //$NON-NLS-1$ 52 | event.getTrigger(), event.getApplicationContext()); 53 | try { 54 | command.executeWithChecks(importEvent); 55 | } catch (CommandException e) { 56 | EclEmmaUIPlugin.log(e); 57 | } 58 | return null; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/ImportSessionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import java.util.Collections; 15 | 16 | import org.eclipse.core.commands.Command; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.core.commands.common.CommandException; 20 | import org.eclipse.ui.IWorkbenchCommandConstants; 21 | import org.eclipse.ui.commands.ICommandService; 22 | import org.eclipse.ui.handlers.HandlerUtil; 23 | 24 | import com.mountainminds.eclemma.core.CoverageTools; 25 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 26 | import com.mountainminds.eclemma.internal.ui.wizards.SessionImportWizard; 27 | 28 | /** 29 | * Handler to import a JaCoCo coverage session. 30 | * 31 | * Unlike the default handler for the import command, this implementation does 32 | * not overwrite menu icons and labels. 33 | */ 34 | public class ImportSessionHandler extends AbstractSessionManagerHandler { 35 | 36 | public ImportSessionHandler() { 37 | super(CoverageTools.getSessionManager()); 38 | } 39 | 40 | public Object execute(ExecutionEvent event) throws ExecutionException { 41 | final ICommandService cs = (ICommandService) HandlerUtil.getActiveSite( 42 | event).getService(ICommandService.class); 43 | final Command command = cs 44 | .getCommand(IWorkbenchCommandConstants.FILE_IMPORT); 45 | final ExecutionEvent importEvent = new ExecutionEvent(command, 46 | Collections.singletonMap("importWizardId", SessionImportWizard.ID), //$NON-NLS-1$ 47 | event.getTrigger(), event.getApplicationContext()); 48 | try { 49 | command.executeWithChecks(importEvent); 50 | } catch (CommandException e) { 51 | EclEmmaUIPlugin.log(e); 52 | } 53 | return null; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/LaunchLabelProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.debug.core.ILaunch; 16 | import org.eclipse.debug.core.ILaunchConfiguration; 17 | import org.eclipse.jface.viewers.LabelProvider; 18 | import org.eclipse.swt.graphics.Image; 19 | 20 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 21 | import com.mountainminds.eclemma.internal.ui.UIMessages; 22 | 23 | /** 24 | * Internal label provider for {@link ILaunch} objects. 25 | */ 26 | class LaunchLabelProvider extends LabelProvider { 27 | 28 | @Override 29 | public String getText(Object element) { 30 | return getLaunchText((ILaunch) element); 31 | } 32 | 33 | @Override 34 | public Image getImage(Object element) { 35 | return EclEmmaUIPlugin.getImage(EclEmmaUIPlugin.ELCL_DUMP); 36 | } 37 | 38 | public static String getLaunchText(ILaunch launch) { 39 | // new launch configuration 40 | final ILaunchConfiguration config = launch.getLaunchConfiguration(); 41 | if (config == null) { 42 | return UIMessages.DumpExecutionDataUnknownLaunch_value; 43 | } 44 | StringBuilder sb = new StringBuilder(config.getName()); 45 | sb.append(" ["); //$NON-NLS-1$ 46 | try { 47 | sb.append(config.getType().getName()); 48 | } catch (CoreException e) { 49 | EclEmmaUIPlugin.log(e); 50 | } 51 | sb.append("]"); //$NON-NLS-1$ 52 | return sb.toString(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/OpenSessionExecutionDataHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.core.commands.ExecutionException; 16 | import org.eclipse.ui.IEditorInput; 17 | import org.eclipse.ui.IWorkbenchWindow; 18 | import org.eclipse.ui.PartInitException; 19 | import org.eclipse.ui.handlers.HandlerUtil; 20 | 21 | import com.mountainminds.eclemma.core.CoverageTools; 22 | import com.mountainminds.eclemma.core.ICoverageSession; 23 | import com.mountainminds.eclemma.internal.ui.UIMessages; 24 | import com.mountainminds.eclemma.internal.ui.editors.CoverageSessionInput; 25 | import com.mountainminds.eclemma.internal.ui.editors.ExecutionDataEditor; 26 | 27 | /** 28 | * Handler to open the execution data of the current session in an editor. 29 | */ 30 | public class OpenSessionExecutionDataHandler extends 31 | AbstractSessionManagerHandler { 32 | 33 | public OpenSessionExecutionDataHandler() { 34 | super(CoverageTools.getSessionManager()); 35 | } 36 | 37 | @Override 38 | public boolean isEnabled() { 39 | return sessionManager.getActiveSession() != null; 40 | } 41 | 42 | public Object execute(ExecutionEvent event) throws ExecutionException { 43 | final ICoverageSession session = sessionManager.getActiveSession(); 44 | final IEditorInput input = new CoverageSessionInput(session); 45 | final IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); 46 | try { 47 | window.getActivePage().openEditor(input, ExecutionDataEditor.ID); 48 | } catch (PartInitException e) { 49 | throw new ExecutionException( 50 | UIMessages.ExecutionDataEditorOpeningError_message, e); 51 | } 52 | return null; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/RelaunchSessionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.core.commands.ExecutionException; 16 | import org.eclipse.debug.core.ILaunchConfiguration; 17 | import org.eclipse.debug.ui.DebugUITools; 18 | 19 | import com.mountainminds.eclemma.core.CoverageTools; 20 | import com.mountainminds.eclemma.core.ICoverageSession; 21 | 22 | /** 23 | * Handler to re-launch the currently active coverage session. 24 | */ 25 | public class RelaunchSessionHandler extends AbstractSessionManagerHandler { 26 | 27 | public RelaunchSessionHandler() { 28 | super(CoverageTools.getSessionManager()); 29 | } 30 | 31 | @Override 32 | public boolean isEnabled() { 33 | final ICoverageSession session = sessionManager.getActiveSession(); 34 | return session != null && session.getLaunchConfiguration() != null; 35 | } 36 | 37 | public Object execute(ExecutionEvent event) throws ExecutionException { 38 | final ICoverageSession session = sessionManager.getActiveSession(); 39 | final ILaunchConfiguration config = session.getLaunchConfiguration(); 40 | DebugUITools.launch(config, CoverageTools.LAUNCH_MODE); 41 | return null; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/RemoveActiveSessionHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.core.commands.ExecutionException; 16 | 17 | import com.mountainminds.eclemma.core.CoverageTools; 18 | import com.mountainminds.eclemma.core.ICoverageSession; 19 | 20 | /** 21 | * Handler to remove the currently active coverage session. 22 | */ 23 | public class RemoveActiveSessionHandler extends AbstractSessionManagerHandler { 24 | 25 | public RemoveActiveSessionHandler() { 26 | super(CoverageTools.getSessionManager()); 27 | } 28 | 29 | @Override 30 | public boolean isEnabled() { 31 | return sessionManager.getActiveSession() != null; 32 | } 33 | 34 | public Object execute(ExecutionEvent event) throws ExecutionException { 35 | final ICoverageSession session = sessionManager.getActiveSession(); 36 | sessionManager.removeSession(session); 37 | return null; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/RemoveAllSessionsHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.core.commands.ExecutionException; 16 | 17 | import com.mountainminds.eclemma.core.CoverageTools; 18 | 19 | /** 20 | * Handler to remove all coverage sessions. 21 | */ 22 | public class RemoveAllSessionsHandler extends AbstractSessionManagerHandler { 23 | 24 | public RemoveAllSessionsHandler() { 25 | super(CoverageTools.getSessionManager()); 26 | } 27 | 28 | @Override 29 | public boolean isEnabled() { 30 | return !sessionManager.getSessions().isEmpty(); 31 | } 32 | 33 | public Object execute(ExecutionEvent event) throws ExecutionException { 34 | sessionManager.removeAllSessions(); 35 | return null; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/ResetOnDumpHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import java.util.Map; 15 | 16 | import org.eclipse.core.commands.AbstractHandler; 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.core.commands.ExecutionException; 19 | import org.eclipse.jface.preference.IPreferenceStore; 20 | import org.eclipse.ui.commands.IElementUpdater; 21 | import org.eclipse.ui.menus.UIElement; 22 | 23 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 24 | import com.mountainminds.eclemma.internal.ui.UIPreferences; 25 | 26 | /** 27 | * Handler to toggle the "reset on dump" option. 28 | */ 29 | public class ResetOnDumpHandler extends AbstractHandler implements 30 | IElementUpdater { 31 | 32 | private final IPreferenceStore preferenceStore; 33 | 34 | public ResetOnDumpHandler() { 35 | preferenceStore = EclEmmaUIPlugin.getInstance().getPreferenceStore(); 36 | } 37 | 38 | public Object execute(ExecutionEvent event) throws ExecutionException { 39 | final boolean flag = preferenceStore 40 | .getBoolean(UIPreferences.PREF_RESET_ON_DUMP); 41 | preferenceStore.setValue(UIPreferences.PREF_RESET_ON_DUMP, !flag); 42 | return null; 43 | } 44 | 45 | public void updateElement(UIElement element, 46 | @SuppressWarnings("rawtypes") Map parameters) { 47 | element.setChecked(preferenceStore 48 | .getBoolean(UIPreferences.PREF_RESET_ON_DUMP)); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/handlers/SelectActiveSessionsItems.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.handlers; 13 | 14 | import org.eclipse.jface.action.ContributionItem; 15 | import org.eclipse.osgi.util.NLS; 16 | import org.eclipse.swt.SWT; 17 | import org.eclipse.swt.events.SelectionAdapter; 18 | import org.eclipse.swt.events.SelectionEvent; 19 | import org.eclipse.swt.widgets.Menu; 20 | import org.eclipse.swt.widgets.MenuItem; 21 | 22 | import com.mountainminds.eclemma.core.CoverageTools; 23 | import com.mountainminds.eclemma.core.ICoverageSession; 24 | import com.mountainminds.eclemma.core.ISessionManager; 25 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 26 | import com.mountainminds.eclemma.internal.ui.UIMessages; 27 | 28 | /** 29 | * Dynamically created menu items for selecting the current coverage session. 30 | */ 31 | public class SelectActiveSessionsItems extends ContributionItem { 32 | 33 | @Override 34 | public boolean isDynamic() { 35 | return true; 36 | } 37 | 38 | @Override 39 | public void fill(final Menu menu, int index) { 40 | final ISessionManager sm = CoverageTools.getSessionManager(); 41 | final ICoverageSession activeSession = sm.getActiveSession(); 42 | int position = 1; 43 | for (ICoverageSession session : sm.getSessions()) { 44 | createItem(menu, index++, session, session == activeSession, position++, 45 | sm); 46 | } 47 | } 48 | 49 | private void createItem(final Menu parent, final int index, 50 | final ICoverageSession session, final boolean selected, 51 | final int position, final ISessionManager sm) { 52 | final MenuItem item = new MenuItem(parent, SWT.RADIO, index); 53 | item.setImage(EclEmmaUIPlugin.getImage(EclEmmaUIPlugin.ELCL_SESSION)); 54 | item.setText(getLabel(session, position)); 55 | item.setSelection(selected); 56 | item.addSelectionListener(new SelectionAdapter() { 57 | @Override 58 | public void widgetSelected(SelectionEvent e) { 59 | sm.activateSession(session); 60 | } 61 | }); 62 | } 63 | 64 | private String getLabel(ICoverageSession session, int idx) { 65 | return NLS.bind(UIMessages.CoverageViewSelectSessionMenu_label, 66 | Integer.valueOf(idx), session.getDescription()); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/launching/NoCoverageDataHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2006, 2016 Mountainminds GmbH & Co. KG and Contributors 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Marc R. Hoffmann - initial API and implementation 10 | * 11 | ******************************************************************************/ 12 | package com.mountainminds.eclemma.internal.ui.launching; 13 | 14 | import org.eclipse.core.runtime.CoreException; 15 | import org.eclipse.core.runtime.IStatus; 16 | import org.eclipse.debug.core.IStatusHandler; 17 | import org.eclipse.jface.dialogs.MessageDialog; 18 | import org.eclipse.swt.widgets.Shell; 19 | 20 | import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin; 21 | import com.mountainminds.eclemma.internal.ui.UIMessages; 22 | 23 | /** 24 | * Status handler that issues an error message when no coverage data has been 25 | * found. 26 | */ 27 | public class NoCoverageDataHandler implements IStatusHandler { 28 | 29 | public Object handleStatus(IStatus status, Object source) 30 | throws CoreException { 31 | 32 | Shell parent = EclEmmaUIPlugin.getInstance().getShell(); 33 | String title = UIMessages.NoCoverageDataError_title; 34 | String message = UIMessages.NoCoverageDataError_message; 35 | 36 | MessageDialog.openError(parent, title, message); 37 | return Boolean.FALSE; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | com.mountainminds.eclemma 5 | eclemma 6 | 2.1.5-SNAPSHOT 7 | pom 8 | 9 | 10 | com.mountainminds.eclemma.build 11 | 12 | 13 | 14 | --------------------------------------------------------------------------------