I know there is QAPlug - Checkstyle and I'm trying to use it.
In menu Project Settings -> QAPlug -> Checkstyle I set Xml configuration file and Jar file as well. Then when Check loaded rules button is pressed such a message pops up:
That's very kind of this plugin it has found rules in XML file. Why isn't it loading them though?
Checkstyle configuration file I'm using:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="severity" value="error"/>
<module name="TreeWalker">
<property name="cacheFile" value="build/checkstyle.cache"/>
<module name="FileContentsHolder"/>
<module name="RegexpSinglelineJava">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="format" value="^\t* +\t*\S"/>
<property name="message"
value="Line has leading space characters; indentation should be performed with tabs only."/>
<property name="ignoreComments" value="true"/>
</module>
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="AvoidStarImport"/>
<module name="IllegalImport">
<property name="illegalPkgs" value="sun, junit.framework, org.hamcrest.CoreMatchers"/>
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="ImportOrder">
<property name="groups" value="/^((?!java).)*$/,/javax\./,/java\./"/>
<property name="ordered" value="true"/>
<property name="separated" value="false"/>
<property name="option" value="bottom"/>
</module>
<module name="ParameterAssignment"/>
<module name="LineLength">
<property name="max" value="180"/>
<property name="tabWidth" value="1"/>
<property name="ignorePattern" value="(^import)|(\s*#ScenarioReference)|(\s*#ScenarioDescription)|(\s*title)|(\s*story)|(\s*#Given)|(\s*#When)|(\s*#Then)|(\s*#Alias)"/>
</module>
<module name="MethodLength"/>
<module name="ParameterNumber">
<property name="max" value="8"/>
</module>
<module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter">
<property name="tokens"
value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="WhitespaceAfter"/>
<!--Please be aware of this bug: http://sourceforge.net/p/checkstyle/bugs/593/-->
<!--[checkstyle-bugs-593] WhitespaceAround wrongly targets annotation element arrays-->
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true" />
</module>
<module name="ModifierOrder"/>
<module name="RedundantModifier"/>
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber">
<property name="severity" value="warning"/>
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, -4"/>
</module>
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="FinalClass"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
<property name="protectedAllowed" value="true"/>
<property name="publicMemberPattern" value="^expectedException$|^temporaryFolder$|^exitRule$|^synchronizedTestRule$|^clearDatabaseRule.*$|^configurationRule$"/>
</module>
<module name="ArrayTypeStyle"/>
<module name="UpperEll"/>
</module>
<module name="Translation"/>
<module name="FileLength"/>
<module name="SuppressionCommentFilter"/>
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE\:(\w+)\:OFF"/>
<property name="onCommentFormat" value="CHECKSTYLE\:(\w+)\:ON"/>
<property name="checkFormat" value="$1"/>
</module>
</module>
Related
My application has a composite persistence unit mainPU which contains 2 members (queryPU and entityPU). When using Criteria API in EclipseLink 2.5, it did not have any problem. However, when upgrading to EclipseLink 2.7, it got error "No [EntityType] was found for the key class [XXX] in the Metamodel" where XXX is the class defined in entityPU
I have some observation regarding the issue:
This problem only occurred when using Criteria API, and there is no
problem when using JPQL.
By default, my application load the mainPU. If I try to get the meta model, it always return empty list. If I explicitly load the
EntityManagerFactory with entityPU in a DAO, then it can load the full list of EntityType, and the problem gone!
EntityManagerFactory factory = Persistence.createEntityManagerFactory("entityPU");
Metamodel m2 = factory.getMetamodel(); //m2 return a list of EntityType!
Is there any wrong configuration in my application for the EclipseLink 2.7?
Below show the persistence.xml
mainPU
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="mainPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/appds</jta-data-source>
<jar-file>icms-entity-lib-0.2.9.544.jar</jar-file>
<jar-file>../icmshrnmc-ejb.jar</jar-file>
<properties>
<property name="jboss.entity.manager.jndi.name" value="java:jboss/persistence/mainPU" />
<property name="eclipselink.target-database"
value="org.eclipse.persistence.platform.database.oracle.Oracle11Platform" />
<property name="eclipselink.target-server" value="JBoss" />
<property name="eclipselink.composite-unit" value="true" />
<property name="eclipselink.session.customizer"
value="x.y.ejb.dao.entity.DefaultEntityInterceptor" />
<property name="eclipselink.logging.level" value="ALL" />
<property name="eclipselink.deploy-on-startup" value="true"/>
</properties>
</persistence-unit>
queryPU
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="queryPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/appds</jta-data-source>
<mapping-file>x/y/icmshrnmc/model/common/dao/namedquery/HrnNat.orm.xml</mapping-file>
...
...
...
<properties>
<property name="eclipselink.composite-unit-member" value="true" />
</properties>
</persistence-unit>
entityPU
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="entityPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/appds</jta-data-source>
<non-jta-data-source>java:jboss/datasources/appds</non-jta-data-source>
<mapping-file>x/y/fmk/model/application/dao/entity/AuditEntity.orm.xml</mapping-file>
...
...
...
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="eclipselink.jdbc.sequence-connection-pool" value="true" />
<property name="eclipselink.jdbc.sequence-connection-pool.non-jta-data-source" value="java:jboss/datasources/fmkseqds" />
</properties>
i'am new in Eclipse RCP. I try to build an RCP project on base of E4 with the default project explorer. I found this two tutorials: dirksmetric.wordpress.com/2012/08/01/tutorial-eclipse-rcp-e4-with-3-x-views-like-project-explorer-properties-etc/ vogella.com/tutorials/Eclipse4MigrationGuide/article.html
After all i have an window with parts but the project explorer is not loaded. This is the stackstrace from log.
!ENTRY org.eclipse.e4.ui.workbench 4 0 2017-07-14 12:11:32.706
!MESSAGE Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityView' from bundle '86'
!STACK 0
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in org.eclipse.ui.internal.e4.compatibility.CompatibilityView
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:408)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:666)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:551)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:535)
at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:70)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:666)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:772)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:743)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:737)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:721)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1289)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:68)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
this ist my plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="product_spside"
point="org.eclipse.core.runtime.products"> <!-- org.eclipse.core.runtime.applications -->
<product application="org.eclipse.e4.ui.workbench.swt.E4Application" name="SPS IDE">
<!-- org.eclipse.e4.ui.workbench.swt.E4Application -->
<property name="appName" value="SPS IDE"> </property>
<property name="applicationXMI" value="spside.rcp/Application.e4xmi"> </property>
</product>
<!-- <application>
<run
class="spside.rcp.Application">
</run>
</application>-->
</extension>
<!-- <extension point="org.eclipse.ui.perspectives">
<perspective
name="RCP Perspective"
class="spside.rcp.Perspective"
id="spside.rcp.perspective">
</perspective>
</extension>-->
</plugin>
I try all tipps from google but i have no idea what to do.
thanks for help!
I made a new RCP project from scratch like in this tutorial and it worked. After this, I realized that my pom.xml of the original project looks different to the new one.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="application"
point="org.eclipse.core.runtime.applications">
<application>
<run
class="spside.rcp.Application">
</run>
</application>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
name="Perspective"
class="spside.rcp.Perspective"
id="spside.rcp.perspective">
</perspective>
</extension>
<extension
point="org.eclipse.ui.views">
<view
name="View"
inject="true"
class="spside.rcp.View"
id="spside.rcp.view">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="*">
<view
standalone="true"
minimized="false"
relative="org.eclipse.ui.editorss"
relationship="left"
id="spside.rcp.view">
</view>
</perspectiveExtension>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu">
<menu
label="File">
<command
commandId="org.eclipse.ui.file.exit"
label="Exit">
</command>
</menu>
</menuContribution>
</extension>
<extension id="product_test" point="org.eclipse.core.runtime.products">
<product application="spside.rcp.application" name="My Product">
<property name="appName" value="SPS IDE"> </property>
<property name="applicationXMI" value="spside.rcp/Application.e4xmi"> </property>
</product>
</extension>
</plugin>
I think the main problem was that I didn't initialize the 3.x Components in the first extension. The next problem was that the second extension point must target to the same id: id="spside.rcp.perspective" as in the Application.e4xmi.
I am configuring one HSQLDB database inside the application folder, follow below the persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="crmUnity" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>br.com.crm.model.entities.Cliente</class>
<class>br.com.crm.model.entities.Contato</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" />
<property name="hibernate.connection.url" value="jdbc:hsqldb:file://database/crm;shutdown=true" />
<property name="hibernate.connection.user" value="sa" />
<property name="hibernate.flushMode" value="FLUSH_AUTO" />
</properties>
</persistence-unit>
</persistence>
The JBOSS 7.1.3 while starting show the error on log:
18:40:10,477 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (ServerService Thread Pool -- 170) HHH000319: Could not get database metadata: java.sql.SQLException: No suitable driver found for jdbc:hsqldb:file://database/crm;shutdown=true
Can anybody help me about configure the jdbc url to resolve this error?
Thank's, TarcĂsio.
below is the Line of code I am writing to execute open Cover
<Target Name="Build">
<!--NUnit-->
<Exec Command="...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe ...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /xml=...\WcfServiceLibrary1\TestResult.xml" />
<!--Open Cover-->
<Exec Command="...\WcfServiceLibrary1\thirdparty\tools\OpenCover\OpenCover.console.exe -register:user -target:...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe -targetargs:...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /noshadow -output:...\WcfServiceLibrary1\Coverage.xml" />
<!--Report generator-->
<Exec Command="...\WcfServiceLibrary1\thirdparty\tools\OpenCover\CoverageReport\ReportGenerator.exe -reports:mycoveragereport.xml -targetdir:...\WcfServiceLibrary1\mycoveragereport.xml" />
</Target>
Now the Coverage Report That I am getting is having missing PDB's statement
<?xml version="1.0" encoding="utf-8"?>
<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="0" minCyclomaticComplexity="0" />
<Modules>
<Module skippedDueTo="Filter" hash="B5-EF-91-87-52-88-4E-B0-F8-8C-F4-4C-97-10-C8-D0-C0-7E-55-19">
<FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll</FullName>
<ModuleName>mscorlib</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="F9-04-A8-31-CD-FB-23-72-95-63-5D-14-9A-A0-66-8E-7F-44-93-7A">
<FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sorttbls.nlp</FullName>
<ModuleName>mscorlib</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="DD-C7-B8-46-28-B0-4A-0B-84-CB-A2-DD-7F-EC-4A-98-75-61-4C-17">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe</FullName>
<ModuleName>nunit-console-x86</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="6E-30-2E-50-36-FB-60-2C-8E-50-C0-83-54-8B-CC-EA-A8-91-B6-CC">
<FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sortkey.nlp</FullName>
<ModuleName>mscorlib</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="79-F8-9A-22-4E-29-52-37-00-CF-81-FF-1F-EA-05-EC-74-2A-2E-C8">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit-console-runner.dll</FullName>
<ModuleName>nunit-console-runner</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
<ModuleName>nunit.core</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="57-DD-20-42-DA-33-B3-EE-DA-8C-8E-25-C9-E5-07-B5-08-62-0F-88">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.util.dll</FullName>
<ModuleName>nunit.util</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
<ModuleName>nunit.core.interfaces</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="2C-99-EE-29-D5-25-03-C4-0E-40-26-9B-F7-DF-C2-68-6E-74-74-31">
<FullName>C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
<ModuleName>System.Configuration</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="D3-99-70-9D-4C-FD-70-CC-82-00-AA-75-7A-54-8C-25-AC-54-B1-BF">
<FullName>C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll</FullName>
<ModuleName>System</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="C4-AD-0A-97-FF-1D-61-5F-88-89-A6-25-BD-02-5E-E5-F5-1D-6F-20">
<FullName>C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
<ModuleName>System.Xml</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="92-44-10-37-4C-84-2D-65-E3-A0-6A-B9-9F-01-42-6A-27-41-4A-8C">
<FullName>C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
<ModuleName>System.Runtime.Remoting</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="94-1E-7C-FB-9C-23-D5-E1-43-03-B3-3C-0B-35-BB-9A-83-CC-9B-65">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll</FullName>
<ModuleName>mscorlib</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="6D-DC-5C-CD-CD-17-D8-34-8A-02-0A-F6-CB-BC-84-81-BD-88-CB-86">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-agent-x86.exe</FullName>
<ModuleName>nunit-agent-x86</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
<ModuleName>nunit.core</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="57-DD-20-42-DA-33-B3-EE-DA-8C-8E-25-C9-E5-07-B5-08-62-0F-88">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.util.dll</FullName>
<ModuleName>nunit.util</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
<ModuleName>nunit.core.interfaces</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="98-5B-33-BC-92-AB-DB-88-FE-EC-F2-8F-04-5B-06-B6-ED-05-0B-00">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</FullName>
<ModuleName>System</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="84-64-E1-D2-0A-E2-91-23-AD-BD-B9-7A-3C-89-7B-66-65-58-46-1C">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
<ModuleName>System.Runtime.Remoting</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="E3-30-C9-0B-9B-B1-9B-30-08-04-31-DB-0F-94-7C-B3-A9-8B-5B-75">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
<ModuleName>System.Configuration</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="A0-AB-0F-DB-C8-A9-ED-50-B7-8B-8A-F2-59-CF-35-5E-E5-F6-78-AF">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
<ModuleName>System.Xml</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="7E-B6-09-DE-71-47-47-2D-10-E4-4A-18-28-FB-3D-17-16-8C-88-6D">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll</FullName>
<ModuleName>System.Web</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="9F-62-A2-66-54-66-BC-CE-FD-0D-1B-20-6E-F7-50-CC-76-C2-6F-D4">
<FullName>C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll</FullName>
<ModuleName>System.Web</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
<ModuleName>nunit.core</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="98-5B-33-BC-92-AB-DB-88-FE-EC-F2-8F-04-5B-06-B6-ED-05-0B-00">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</FullName>
<ModuleName>System</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="C8-69-A6-5A-0E-1E-E0-29-EB-EF-CA-C5-2C-E2-B7-EB-F6-D9-64-1A">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\pnunit.framework.dll</FullName>
<ModuleName>pnunit.framework</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="F9-30-3E-D0-DF-D4-B8-50-24-2D-CB-99-08-61-9C-77-28-1C-6D-29">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\pnunit-agent.exe</FullName>
<ModuleName>pnunit-agent</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
<ModuleName>nunit.core.interfaces</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="50-42-5D-72-64-97-F8-84-32-24-43-4B-DF-ED-F6-E0-13-A5-E5-0D">
<FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\f065302a\85aa24e8_1fc4ce01\UnitTestProject1.dll</FullName>
<ModuleName>UnitTestProject1</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="13-4C-94-D1-A1-A5-D9-8F-F1-E4-CE-A7-87-EF-CC-42-FC-6B-CA-BC">
<FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\f468205a\003c8368_6cb0cd01\nunit.framework.dll</FullName>
<ModuleName>nunit.framework</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="79-F8-9A-22-4E-29-52-37-00-CF-81-FF-1F-EA-05-EC-74-2A-2E-C8">
<FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit-console-runner.dll</FullName>
<ModuleName>nunit-console-runner</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="84-64-E1-D2-0A-E2-91-23-AD-BD-B9-7A-3C-89-7B-66-65-58-46-1C">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
<ModuleName>System.Runtime.Remoting</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="E3-30-C9-0B-9B-B1-9B-30-08-04-31-DB-0F-94-7C-B3-A9-8B-5B-75">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
<ModuleName>System.Configuration</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="Filter" hash="A0-AB-0F-DB-C8-A9-ED-50-B7-8B-8A-F2-59-CF-35-5E-E5-F6-78-AF">
<FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
<ModuleName>System.Xml</ModuleName>
<Classes />
</Module>
<Module skippedDueTo="MissingPdb" hash="FF-78-B2-8E-E7-37-5C-12-16-D2-B5-9F-24-7A-E2-2D-4B-AC-F2-3D">
<FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\78ee3213\e91005a5_1fc4ce01\WcfServiceLibrary1.dll</FullName>
<ModuleName>WcfServiceLibrary1</ModuleName>
<Classes />
</Module>
</Modules>
</CoverageSession>
I have created the pdbs in the respective folders where the dlls are residing still cannot figure out why OpenCover is not able to find them. Please help. Thanks in advance
You either need to use /noshadow when executing nunit or you need to use -targetdir: with OpenCover.
Now I can see that you trying to use /noshadow but it looks like you may not have constructed your command line properly (it could just be wrong as you have modified it to hide paths and inadvertently edited it).
You need to use quotes to ensure all you arguments that you intend to send to nunit stay together but because you are using msbuild you need to escape them i.e.
<Exec Command=""...\WcfServiceLibrary1\thirdparty\tools\OpenCover\OpenCover.console.exe" -register:user "-target:...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe" "-targetargs:...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /noshadow" "-output:...\WcfServiceLibrary1\Coverage.xml"" />
Regardless of the following persistence.xml configuration the database is persisted on disk.
<persistence-unit name="com.mysimpatico_inmemory_persistence_nbm_1.0-SNAPSHOTPU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.mysimpatico.memoplatform.persistence.entities.Expression</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:tempDb;create=true"/>
<property name="javax.persistence.jdbc.password" value=""/>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="javax.persistence.jdbc.user" value=""/>
</properties>
http://wiki.apache.org/db-derby/InMemoryBackEndPrimer
I'm using Derby in memory for testing and my configuration is very close to yours.
Here is my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">
<persistence-unit name="TestPu" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.acme.Foo</class>
<class>com.acme.Bar</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- Common properties -->
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:derby:memory:test-jpa;create=true"/>
<property name="javax.persistence.jdbc.user" value="APP"/>
<property name="javax.persistence.jdbc.password" value="APP"/>
<!-- EclipseLink specific properties -->
<property name="eclipselink.target-database" value="Derby"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.debug" value="ALL"/>
<property name="eclipselink.weaving" value="static"/>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.level.sql" value="FINEST"/>
<property name="eclipselink.logging.level.cache" value="FINEST"/>
</properties>
</persistence-unit>
</persistence>
Where org.apache.derby:derby:jar:10.6.2.1 is on the classpath.
Now two questions/suggestions:
How do you know the database is persisted on disk?
If it really does, make sure you're using the persistence.xml you think you are.
Add the following to your maven configuration
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.3.2.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.5.3.0</version>
<scope>test</scope>
</dependency>
The following persistance.xml works pretty well with hibernate.
<persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>myapp.model.entities.Group</class>
<class>myapp.model.entities.User</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.connection.url" value="jdbc:derby:memory:jpa"/>
<property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.DerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create"/>
<property name="hibernate.connection.username" value=""/>
<property name="hibernate.connection.password" value=""/>
</properties>
</persistence-unit>