You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Stephen Cameron <st...@gmail.com> on 2015/09/28 20:47:25 UTC

problem with Integration testing trying to run a single test

Hi,

I have a problem running a single in integration testing, I get an error
message saying that a table is not present. This is not seen when I run the
whole integtest project via 'mvn test'.

I don't think that the specific class mentioned is the problem, as I say
its created successfully everywhere else. Maybe wrong, so the class code is
after the error below.

04:41:17,983  [Schema               Thread-0   DEBUG]  An error occurred
while auto-creating schema elements - rolling back
Persistent class
"au.com.scds.chats.dom.module.general.names.ClassificationValue" has no
table in the database, but the operation requires it. Please check the
specification of the MetaData for this class.
org.datanucleus.store.rdbms.exceptions.NoTableManagedException: Persistent
class "au.com.scds.chats.dom.module.general.names.ClassificationValue" has
no table in the database, but the operation requires it. Please check the
specification of the MetaData for this class.
    at
org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
    at
org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
    at
org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
    at
org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
    at
org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
    at
org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
    at
org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
    at
org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:196)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:155)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:110)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:103)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createDataNucleusApplicationComponentsIfRequired(DataNucleusPersistenceMechanismInstaller.java:134)
    at
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createObjectStore(DataNucleusPersistenceMechanismInstaller.java:110)
    at
org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createPersistenceSession(PersistenceSessionFactory.java:95)
    at
org.apache.isis.core.runtime.system.session.IsisSessionFactory.openSession(IsisSessionFactory.java:141)
    at
org.apache.isis.core.runtime.system.context.IsisContextStatic.openSessionInstance(IsisContextStatic.java:70)
    at
org.apache.isis.core.runtime.system.context.IsisContext.openSession(IsisContext.java:279)
    at
org.apache.isis.core.runtime.system.IsisSystem.shutdownServices(IsisSystem.java:311)
    at
org.apache.isis.core.runtime.system.IsisSystem.shutdown(IsisSystem.java:300)
    at
org.apache.isis.core.integtestsupport.IsisSystemForTest.shutdown(IsisSystemForTest.java:467)
    at
org.apache.isis.core.integtestsupport.IsisSystemForTest.access$100(IsisSystemForTest.java:74)
    at
org.apache.isis.core.integtestsupport.IsisSystemForTest$Builder$1.run(IsisSystemForTest.java:301)
04:41:17,985  [ObjectReflectorDefault Thread-0   INFO ]  shutting down
org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault@3b4eb5a4


package au.com.scds.chats.dom.module.general.names;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.PrimaryKey;

import au.com.scds.chats.dom.AbstractNamedChatsDomainEntity;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public abstract class ClassificationValue {

    private String name;

    @PrimaryKey
    @Column(allowsNull="false")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (!this.getClass().isInstance(obj)) {
            return false;
        }
        return ((ClassificationValue) obj).getName().equals(this.getName());
    }

    @Override
    public String toString() {
        return this.getClass().getName() + ":" + this.getName();
    }
}

Re: problem with Integration testing trying to run a single test

Posted by Stephen Cameron <st...@gmail.com>.
Oops, also the test is currently trivial



package domainapp.integtests.tests.modules.reports;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.List;

import javax.inject.Inject;

import org.apache.isis.applib.fixturescripts.FixtureScripts;
import org.joda.time.DateTime;
import org.junit.Test;

import au.com.scds.chats.dom.module.activity.Activities;
import au.com.scds.chats.dom.module.activity.ActivityEvent;
import
au.com.scds.chats.dom.module.reports.ParticipantDateLastAttendedResult;
import au.com.scds.chats.dom.module.reports.ReportsList;
import domainapp.integtests.tests.DomainAppIntegTest;
import domainapp.integtests.tests.modules.activity.ActivitiesIntegTest;

public class ReportsIntegTest extends DomainAppIntegTest {

    @Inject
    ReportsList reports;

    public static class Create extends ReportsIntegTest {

        @Test
        public void happyCase() throws Exception {

            // given
            //DateTime startDateTime = new DateTime();

            // when
            List<ParticipantDateLastAttendedResult> results =
wrap(reports).ParticipantsByMonthsInactiveReport(null);

            // then
            assertThat(results.size()).isEqualTo(0);
        }
    }
}

On Tue, Sep 29, 2015 at 4:47 AM, Stephen Cameron <steve.cameron.62@gmail.com
> wrote:

> Hi,
>
> I have a problem running a single in integration testing, I get an error
> message saying that a table is not present. This is not seen when I run the
> whole integtest project via 'mvn test'.
>
> I don't think that the specific class mentioned is the problem, as I say
> its created successfully everywhere else. Maybe wrong, so the class code is
> after the error below.
>
> 04:41:17,983  [Schema               Thread-0   DEBUG]  An error occurred
> while auto-creating schema elements - rolling back
> Persistent class
> "au.com.scds.chats.dom.module.general.names.ClassificationValue" has no
> table in the database, but the operation requires it. Please check the
> specification of the MetaData for this class.
> org.datanucleus.store.rdbms.exceptions.NoTableManagedException: Persistent
> class "au.com.scds.chats.dom.module.general.names.ClassificationValue" has
> no table in the database, but the operation requires it. Please check the
> specification of the MetaData for this class.
>     at
> org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
>     at
> org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
>     at
> org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
>     at
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
>     at
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
>     at
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
>     at
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
>     at
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:196)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:155)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:110)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:103)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createDataNucleusApplicationComponentsIfRequired(DataNucleusPersistenceMechanismInstaller.java:134)
>     at
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createObjectStore(DataNucleusPersistenceMechanismInstaller.java:110)
>     at
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createPersistenceSession(PersistenceSessionFactory.java:95)
>     at
> org.apache.isis.core.runtime.system.session.IsisSessionFactory.openSession(IsisSessionFactory.java:141)
>     at
> org.apache.isis.core.runtime.system.context.IsisContextStatic.openSessionInstance(IsisContextStatic.java:70)
>     at
> org.apache.isis.core.runtime.system.context.IsisContext.openSession(IsisContext.java:279)
>     at
> org.apache.isis.core.runtime.system.IsisSystem.shutdownServices(IsisSystem.java:311)
>     at
> org.apache.isis.core.runtime.system.IsisSystem.shutdown(IsisSystem.java:300)
>     at
> org.apache.isis.core.integtestsupport.IsisSystemForTest.shutdown(IsisSystemForTest.java:467)
>     at
> org.apache.isis.core.integtestsupport.IsisSystemForTest.access$100(IsisSystemForTest.java:74)
>     at
> org.apache.isis.core.integtestsupport.IsisSystemForTest$Builder$1.run(IsisSystemForTest.java:301)
> 04:41:17,985  [ObjectReflectorDefault Thread-0   INFO ]  shutting down
> org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault@3b4eb5a4
>
>
> package au.com.scds.chats.dom.module.general.names;
>
> import javax.jdo.annotations.Column;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.Inheritance;
> import javax.jdo.annotations.InheritanceStrategy;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.PrimaryKey;
>
> import au.com.scds.chats.dom.AbstractNamedChatsDomainEntity;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> public abstract class ClassificationValue {
>
>     private String name;
>
>     @PrimaryKey
>     @Column(allowsNull="false")
>     public String getName() {
>         return name;
>     }
>
>     public void setName(String name) {
>         this.name = name;
>     }
>
>     @Override
>     public boolean equals(final Object obj) {
>         if (obj == null) {
>             return false;
>         }
>         if (obj == this) {
>             return true;
>         }
>         if (!this.getClass().isInstance(obj)) {
>             return false;
>         }
>         return ((ClassificationValue)
> obj).getName().equals(this.getName());
>     }
>
>     @Override
>     public String toString() {
>         return this.getClass().getName() + ":" + this.getName();
>     }
> }
>
>

Re: problem with Integration testing trying to run a single test

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
not sure, hard to say.  With Eclipse the compiler automatically runs
whenever it determines that the .class files are out of date, but (I've
found) it difficult to predict exactly when that is.

On IntelliJ things are rather simpler ... we use its ability to run a mvn
command before running any launch configuration.  So, for this use case, I
would normally run the individual integration tests (having it create a
launch configuration on the fly), expect it to fail due to a similar error
that you've reported, then would go back to the launch configuration and
modify it to run the enhancer first.  Or, if I was going to be running lots
of individual integration tests, then I'd set up a default for all tests to
run the enhancer via mvn first.

This technique doesn't really work with Eclipse though; the major
difference in philosophy between the two IDEs (so far as I can tell) is
that IntelliJ is always monitoring the filesystem, whereas with Eclipse one
needs to explicitly do a refresh.

Not sure any of that helps you, just reporting what I've observed in using
these IDEs...

Dan


On 28 September 2015 at 20:14, Stephen Cameron <st...@gmail.com>
wrote:

> Yes, that is a likely explanation, but not clear why it should be so, if
> the dom project has been built and enhanced, why do the integtests need to
> do it over?
>
> I am using Eclipse.
>
> On Tue, Sep 29, 2015 at 5:04 AM, Dan Haywood <dan@haywood-associates.co.uk
> >
> wrote:
>
> > My guess is that the class isn't enhanced.
> >
> > I can't remember if you use Eclipse it IntelliJ, but either way I imagine
> > the IDE has recompiled the domain classes in order to then run the test,
> > without the enhancer being run.
> >
> > The are various ways around this, depends on the ide in use..
> >
> > Hth,
> > Dan.
> > On 28 Sep 2015 19:47, "Stephen Cameron" <st...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I have a problem running a single in integration testing, I get an
> error
> > > message saying that a table is not present. This is not seen when I run
> > the
> > > whole integtest project via 'mvn test'.
> > >
> > > I don't think that the specific class mentioned is the problem, as I
> say
> > > its created successfully everywhere else. Maybe wrong, so the class
> code
> > is
> > > after the error below.
> > >
> > > 04:41:17,983  [Schema               Thread-0   DEBUG]  An error
> occurred
> > > while auto-creating schema elements - rolling back
> > > Persistent class
> > > "au.com.scds.chats.dom.module.general.names.ClassificationValue" has no
> > > table in the database, but the operation requires it. Please check the
> > > specification of the MetaData for this class.
> > > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> > Persistent
> > > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> > has
> > > no table in the database, but the operation requires it. Please check
> the
> > > specification of the MetaData for this class.
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> > >     at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:196)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:155)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:110)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:103)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createDataNucleusApplicationComponentsIfRequired(DataNucleusPersistenceMechanismInstaller.java:134)
> > >     at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createObjectStore(DataNucleusPersistenceMechanismInstaller.java:110)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createPersistenceSession(PersistenceSessionFactory.java:95)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.session.IsisSessionFactory.openSession(IsisSessionFactory.java:141)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.context.IsisContextStatic.openSessionInstance(IsisContextStatic.java:70)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.context.IsisContext.openSession(IsisContext.java:279)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.IsisSystem.shutdownServices(IsisSystem.java:311)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.IsisSystem.shutdown(IsisSystem.java:300)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest.shutdown(IsisSystemForTest.java:467)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest.access$100(IsisSystemForTest.java:74)
> > >     at
> > >
> > >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest$Builder$1.run(IsisSystemForTest.java:301)
> > > 04:41:17,985  [ObjectReflectorDefault Thread-0   INFO ]  shutting down
> > >
> org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault@3b4eb5a4
> > >
> > >
> > > package au.com.scds.chats.dom.module.general.names;
> > >
> > > import javax.jdo.annotations.Column;
> > > import javax.jdo.annotations.IdentityType;
> > > import javax.jdo.annotations.Inheritance;
> > > import javax.jdo.annotations.InheritanceStrategy;
> > > import javax.jdo.annotations.PersistenceCapable;
> > > import javax.jdo.annotations.PrimaryKey;
> > >
> > > import au.com.scds.chats.dom.AbstractNamedChatsDomainEntity;
> > >
> > > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> > > public abstract class ClassificationValue {
> > >
> > >     private String name;
> > >
> > >     @PrimaryKey
> > >     @Column(allowsNull="false")
> > >     public String getName() {
> > >         return name;
> > >     }
> > >
> > >     public void setName(String name) {
> > >         this.name = name;
> > >     }
> > >
> > >     @Override
> > >     public boolean equals(final Object obj) {
> > >         if (obj == null) {
> > >             return false;
> > >         }
> > >         if (obj == this) {
> > >             return true;
> > >         }
> > >         if (!this.getClass().isInstance(obj)) {
> > >             return false;
> > >         }
> > >         return ((ClassificationValue)
> > > obj).getName().equals(this.getName());
> > >     }
> > >
> > >     @Override
> > >     public String toString() {
> > >         return this.getClass().getName() + ":" + this.getName();
> > >     }
> > > }
> > >
> >
>

Re: problem with Integration testing trying to run a single test

Posted by Stephen Cameron <st...@gmail.com>.
Yes, that is a likely explanation, but not clear why it should be so, if
the dom project has been built and enhanced, why do the integtests need to
do it over?

I am using Eclipse.

On Tue, Sep 29, 2015 at 5:04 AM, Dan Haywood <da...@haywood-associates.co.uk>
wrote:

> My guess is that the class isn't enhanced.
>
> I can't remember if you use Eclipse it IntelliJ, but either way I imagine
> the IDE has recompiled the domain classes in order to then run the test,
> without the enhancer being run.
>
> The are various ways around this, depends on the ide in use..
>
> Hth,
> Dan.
> On 28 Sep 2015 19:47, "Stephen Cameron" <st...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I have a problem running a single in integration testing, I get an error
> > message saying that a table is not present. This is not seen when I run
> the
> > whole integtest project via 'mvn test'.
> >
> > I don't think that the specific class mentioned is the problem, as I say
> > its created successfully everywhere else. Maybe wrong, so the class code
> is
> > after the error below.
> >
> > 04:41:17,983  [Schema               Thread-0   DEBUG]  An error occurred
> > while auto-creating schema elements - rolling back
> > Persistent class
> > "au.com.scds.chats.dom.module.general.names.ClassificationValue" has no
> > table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.
> > org.datanucleus.store.rdbms.exceptions.NoTableManagedException:
> Persistent
> > class "au.com.scds.chats.dom.module.general.names.ClassificationValue"
> has
> > no table in the database, but the operation requires it. Please check the
> > specification of the MetaData for this class.
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
> >     at
> >
> >
> org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
> >     at
> >
> >
> org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> >     at
> >
> >
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> >     at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:196)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:155)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:110)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:103)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createDataNucleusApplicationComponentsIfRequired(DataNucleusPersistenceMechanismInstaller.java:134)
> >     at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createObjectStore(DataNucleusPersistenceMechanismInstaller.java:110)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createPersistenceSession(PersistenceSessionFactory.java:95)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.session.IsisSessionFactory.openSession(IsisSessionFactory.java:141)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.context.IsisContextStatic.openSessionInstance(IsisContextStatic.java:70)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.context.IsisContext.openSession(IsisContext.java:279)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.IsisSystem.shutdownServices(IsisSystem.java:311)
> >     at
> >
> >
> org.apache.isis.core.runtime.system.IsisSystem.shutdown(IsisSystem.java:300)
> >     at
> >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest.shutdown(IsisSystemForTest.java:467)
> >     at
> >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest.access$100(IsisSystemForTest.java:74)
> >     at
> >
> >
> org.apache.isis.core.integtestsupport.IsisSystemForTest$Builder$1.run(IsisSystemForTest.java:301)
> > 04:41:17,985  [ObjectReflectorDefault Thread-0   INFO ]  shutting down
> > org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault@3b4eb5a4
> >
> >
> > package au.com.scds.chats.dom.module.general.names;
> >
> > import javax.jdo.annotations.Column;
> > import javax.jdo.annotations.IdentityType;
> > import javax.jdo.annotations.Inheritance;
> > import javax.jdo.annotations.InheritanceStrategy;
> > import javax.jdo.annotations.PersistenceCapable;
> > import javax.jdo.annotations.PrimaryKey;
> >
> > import au.com.scds.chats.dom.AbstractNamedChatsDomainEntity;
> >
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> > public abstract class ClassificationValue {
> >
> >     private String name;
> >
> >     @PrimaryKey
> >     @Column(allowsNull="false")
> >     public String getName() {
> >         return name;
> >     }
> >
> >     public void setName(String name) {
> >         this.name = name;
> >     }
> >
> >     @Override
> >     public boolean equals(final Object obj) {
> >         if (obj == null) {
> >             return false;
> >         }
> >         if (obj == this) {
> >             return true;
> >         }
> >         if (!this.getClass().isInstance(obj)) {
> >             return false;
> >         }
> >         return ((ClassificationValue)
> > obj).getName().equals(this.getName());
> >     }
> >
> >     @Override
> >     public String toString() {
> >         return this.getClass().getName() + ":" + this.getName();
> >     }
> > }
> >
>

Re: problem with Integration testing trying to run a single test

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
My guess is that the class isn't enhanced.

I can't remember if you use Eclipse it IntelliJ, but either way I imagine
the IDE has recompiled the domain classes in order to then run the test,
without the enhancer being run.

The are various ways around this, depends on the ide in use..

Hth,
Dan.
On 28 Sep 2015 19:47, "Stephen Cameron" <st...@gmail.com> wrote:

> Hi,
>
> I have a problem running a single in integration testing, I get an error
> message saying that a table is not present. This is not seen when I run the
> whole integtest project via 'mvn test'.
>
> I don't think that the specific class mentioned is the problem, as I say
> its created successfully everywhere else. Maybe wrong, so the class code is
> after the error below.
>
> 04:41:17,983  [Schema               Thread-0   DEBUG]  An error occurred
> while auto-creating schema elements - rolling back
> Persistent class
> "au.com.scds.chats.dom.module.general.names.ClassificationValue" has no
> table in the database, but the operation requires it. Please check the
> specification of the MetaData for this class.
> org.datanucleus.store.rdbms.exceptions.NoTableManagedException: Persistent
> class "au.com.scds.chats.dom.module.general.names.ClassificationValue" has
> no table in the database, but the operation requires it. Please check the
> specification of the MetaData for this class.
>     at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:698)
>     at
>
> org.datanucleus.store.rdbms.table.ClassTable.initializePK(ClassTable.java:1003)
>     at
>
> org.datanucleus.store.rdbms.table.ClassTable.preInitialize(ClassTable.java:250)
>     at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTable(RDBMSStoreManager.java:3194)
>     at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2993)
>     at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
>     at
>
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
>     at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:196)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:155)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:110)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusApplicationComponents.<init>(DataNucleusApplicationComponents.java:103)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createDataNucleusApplicationComponentsIfRequired(DataNucleusPersistenceMechanismInstaller.java:134)
>     at
>
> org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller.createObjectStore(DataNucleusPersistenceMechanismInstaller.java:110)
>     at
>
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createPersistenceSession(PersistenceSessionFactory.java:95)
>     at
>
> org.apache.isis.core.runtime.system.session.IsisSessionFactory.openSession(IsisSessionFactory.java:141)
>     at
>
> org.apache.isis.core.runtime.system.context.IsisContextStatic.openSessionInstance(IsisContextStatic.java:70)
>     at
>
> org.apache.isis.core.runtime.system.context.IsisContext.openSession(IsisContext.java:279)
>     at
>
> org.apache.isis.core.runtime.system.IsisSystem.shutdownServices(IsisSystem.java:311)
>     at
>
> org.apache.isis.core.runtime.system.IsisSystem.shutdown(IsisSystem.java:300)
>     at
>
> org.apache.isis.core.integtestsupport.IsisSystemForTest.shutdown(IsisSystemForTest.java:467)
>     at
>
> org.apache.isis.core.integtestsupport.IsisSystemForTest.access$100(IsisSystemForTest.java:74)
>     at
>
> org.apache.isis.core.integtestsupport.IsisSystemForTest$Builder$1.run(IsisSystemForTest.java:301)
> 04:41:17,985  [ObjectReflectorDefault Thread-0   INFO ]  shutting down
> org.apache.isis.core.metamodel.specloader.ObjectReflectorDefault@3b4eb5a4
>
>
> package au.com.scds.chats.dom.module.general.names;
>
> import javax.jdo.annotations.Column;
> import javax.jdo.annotations.IdentityType;
> import javax.jdo.annotations.Inheritance;
> import javax.jdo.annotations.InheritanceStrategy;
> import javax.jdo.annotations.PersistenceCapable;
> import javax.jdo.annotations.PrimaryKey;
>
> import au.com.scds.chats.dom.AbstractNamedChatsDomainEntity;
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION)
> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> public abstract class ClassificationValue {
>
>     private String name;
>
>     @PrimaryKey
>     @Column(allowsNull="false")
>     public String getName() {
>         return name;
>     }
>
>     public void setName(String name) {
>         this.name = name;
>     }
>
>     @Override
>     public boolean equals(final Object obj) {
>         if (obj == null) {
>             return false;
>         }
>         if (obj == this) {
>             return true;
>         }
>         if (!this.getClass().isInstance(obj)) {
>             return false;
>         }
>         return ((ClassificationValue)
> obj).getName().equals(this.getName());
>     }
>
>     @Override
>     public String toString() {
>         return this.getClass().getName() + ":" + this.getName();
>     }
> }
>