Coder Social home page Coder Social logo

datanucleus / tests Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 19.0 18.13 MB

Test suites for DataNucleus using JDO, JPA, Jakarta and REST APIs

License: Apache License 2.0

Java 97.52% HTML 0.28% Shell 0.17% Batchfile 0.23% Perl 0.07% Python 0.02% XSLT 1.70%

tests's Introduction

tests

Test suites for testing DataNucleus using JDO, JPA and REST APIs.

Build "framework", "framework.maven" and "samples" first, then use the tests for the API in question.

Raise issues in the GitHub issue tracker for this repository.

Running tests

Tests are run using framework.maven which is a custom maven plugin that allows the tests to be executed for different configurations e.g. optimistic, pessimistic. It will create several Maven Surefire executions dynamically to test different configurations. Some test projects also have more than one execution configured, allowing tests to be run for different identity types as well i.e. application or datastore.

Here are few examples on how to run the tests:

  • Run all the executions and default configuration

mvn clean test

  • Run all the executions with optimistic and pessimistic configuration

mvn -Dtest.configs=optimistic,pessimistic clean test

On "jdo/identity" this will trigger 4 different executions, each configuration is run for each execution.

  • Run the CollectionTest, skipping "application-identity" execution and using optimistic configuration

mvn -Dtest=CollectionTest -Dtest.configs=optimistic -Dtest.application-identity.skip=true clean test

  • Run all the executions with optimistic using MySQL database

mvn -Pmysql -Dtest.configs=optimistic clean test

Database cleanup

Before running each test set execution the databased will be cleaned up automatically. This clean up can be skipped by setting maven.datanucleus.test.skip.reset property to true.

mvn -Pmysql -Dmaven.datanucleus.test.skip.reset=true clean test

tests's People

Contributors

andyjefferson avatar dependabot[bot] avatar ergunbaris avatar kraendavid avatar nlmarco avatar renataogarcia avatar spassignat avatar yunus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tests's Issues

Separate test framework into JDO and JPA

Means we don't have api-jdo in the CLASSPATH when using JPA! Also means we have a different cleanup process because currently it runs a JPA test then tries to clean up using JDO!

how to define persistence using XML metadata and mark which are persistable

In the JDO Tutorial, I define persistence using XML metadata,but the classes have not enhanced,
jdo tutorial

this is example:
`@PersistenceCapable
public class Product
{
// @PrimaryKey
// @Persistent(valueStrategy=IdGeneratorStrategy.NATIVE)
protected long id;

protected String name=null;

protected String description=null;

protected double price=0.0;

public Product(String name, String description, double price)
{
    this.name = name;
    this.description = description;
    this.price = price;
}

public long getId()
{
    return id;
}

public String getName()
{
    return name;
}

public String getDescription()
{
    return description;
}

public double getPrice()
{
    return price;
}

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

public void setDescription(String description)
{
    this.description = description;
}

public void setPrice(double price)
{
    this.price = price;
}

public String toString()
{
    return "Product : " + id + " name=" + name + " [" + description + "]";
}

}`

like this, run successed, but I remove the “@PersistenceCapable” annotation,
how to define model classes using xml metadata?

In the sample project, I define package.jdo in resource like this:
`

    <class name="Product"   persistence-modifier="persistence-capable">
        <field name="id" />
        <field name="name" />
        <field name="description"/>
        <field name="price"/>
    </class>
</package>

`

using maven plugin
mvn datanucleus:enhance
result:
[INFO] DataNucleus Enhancer (version 5.0.1) for API "JDO" DataNucleus Enhancer completed with success for 0 classes. DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details

no classes were enhanced,so how to define persistence only using xml metadata?

Drop duplicated tests from jdo/{datastore} packages

We originally added jdo/hbase, jdo/spreadsheet, jdo/cassandra etc to give a simple way of testing other datastores since those datastores did not support all features and the test suite did not provide a way of easily disabling some of the main tests for particular datastores. We now allow that so jdo/general should be runnable (to some degree) with most datastores.

With this in mind we should aim to drop any duplicated tests from the jdo/{datastore} area where it is not datastore-specific.

Tests and JDK Version 1.8?

As of this commit the tests are coded to work with JDK 1.8 specifically, but lots of us folks out here have not moved to 1.8 yet, or for many of our enterprise customers, are still using 1.6. Is there any reason why an enterprise enabled product such as datanucleus would switch its builds to default to JDK 1.8? Is there a work-around to disable all these changes? Perhaps there is some global setting to effectively ignore all the changes made in this commit?

43297d6

Ideally I would love to see this change reverted.

-Bob

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.