use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.
the class StoredInObjectOptimisticLockTest method verify.
/**
* Verify if the objects match completely through allowing the session to use the descriptors.
* This will compare the objects and all of their privately owned parts.
*/
@Override
protected void verify() {
Session remoteServer = ((DistributedServer) DistributedServersModel.getDistributedServers().get(0)).getDistributedSession();
// The main session is now in transaction (started in TransactionalTestCase.setup).
// remoteServer was setup to share accessor (and therefore connection) with the main session (see DistributedServer constructor),
// therefore remoteServer's connection is in transaction.
// Because it seems there is no way to write object with version without transaction,
// let's compare versions directly
Client remoteClient = (Client) remoteServer.executeQuery(this.query);
if (remoteClient.getVersion().getVersion() != ((Client) objectToBeWritten).getVersion().getVersion()) {
throw new TestErrorException("Failed to copy the version number to the remote system");
}
}
use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.
the class AggregateTestModel method getSRGCheckForNullUnitOfWorkTestSuite.
// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGCheckForNullUnitOfWorkTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("AggregateCheckForNullUnitOfWorkTestSuite");
suite.setDescription("This suite tests updating objects with UOW in the aggregate model.");
Class<Employee> employeeClass = Employee.class;
Class<Client> clientClass = Client.class;
PopulationManager manager = PopulationManager.getDefaultManager();
suite.addTest(new CheckForNullUnitOfWorkTest(manager.getObject(employeeClass, "example1")));
suite.addTest(new CheckForNullUnitOfWorkTest(manager.getObject(employeeClass, "example2")));
suite.addTest(new CheckForNullUnitOfWorkTest(manager.getObject(employeeClass, "example3")));
return suite;
}
use of org.eclipse.persistence.testing.models.aggregate.Client in project eclipselink by eclipse-ee4j.
the class AggregateTestModel method getSRGUpdateObjectTestSuite.
// SRG test set is maintained by QA only, do NOT add any new tests into it.
public static TestSuite getSRGUpdateObjectTestSuite() {
TestSuite suite = new TestSuite();
suite.setName("AggregateUpdateObjectTestSuite");
suite.setDescription("This suite tests the updating of each object in the aggregate model.");
Class<Employee1> employee1Class = Employee1.class;
Class<Employee> employeeClass = Employee.class;
Class<Client> clientClass = Client.class;
Class<EvaluationClient> evaluationClientClass = EvaluationClient.class;
PopulationManager manager = PopulationManager.getDefaultManager();
// =================================================================================
suite.addTest(new WriteObjectTest(manager.getObject(employee1Class, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employee1Class, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employee1Class, "example2")));
// =================================================================================
suite.addTest(new WriteObjectTest(manager.getObject(employeeClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example2")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(employeeClass, "example3")));
suite.addTest(new WriteObjectTest(manager.getObject(clientClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example2")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(clientClass, "example3")));
suite.addTest(new WriteObjectTest(manager.getObject(evaluationClientClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example2")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(evaluationClientClass, "example3")));
// update testing on aggregate collection mapping
suite.addTest(new WriteObjectTest(manager.getObject(Agent.class, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Agent.class, "example1")));
if (useNewAggregateCollection) {
suite.addTest(new WriteObjectTest(manager.getObject(Builder.class, "example1")));
suite.addTest(new UnitOfWorkBasicUpdateObjectTest(manager.getObject(Builder.class, "example1")));
}
return suite;
}
Aggregations