Package org.apache.isis.core.metamodel.testspec

Examples of org.apache.isis.core.metamodel.testspec.TestProxySpecification


        objectStore = new XmlObjectStore(dataManager, new DummyServiceManager());
        objectStore.setClock(new DefaultClock());

        // objects
        configuration = new TestProxyConfiguration();
        spec = new TestProxySpecification(this.getClass());
        spec.fields = Collections.emptyList();
        adapter = new TestProxyAdapter();
        adapter.setupSpecification(spec);
        adapter.setOptimisticLock(new SerialNumberVersion(23, null, null));
        adapter.setupOid(SerialOid.createPersistent(1));
View Full Code Here


        return "Name";
    }

    @Override
    public ObjectSpecification getSpecification() {
        return new TestProxySpecification("java.lang.String");
    }
View Full Code Here

    @Override
    public ObjectSpecification loadSpecification(final String name) {
        if (specificationByFullName.containsKey(name)) {
            return specificationByFullName.get(name);
        } else {
            final TestProxySpecification specification = new TestProxySpecification(name);
            specificationByFullName.put(specification.getFullIdentifier(), specification);
            return specification;

            // throw new ObjectAdapterRuntimeException("no specification for " +
            // name);
        }
View Full Code Here

        algorithm = new DefaultPersistAlgorithm();

        object = system.createTransientTestObject();
        // object.setupResolveState(ResolveState.TRANSIENT);

        final TestProxySpecification spec = system.getSpecification(object);
        final List<ObjectAssociation> fields = Arrays.asList((ObjectAssociation) new OneToOneAssociationTest() {

            @Override
            public void initAssociation(final ObjectAdapter inObject, final ObjectAdapter associate) {
            }

            @Override
            public Consent isAssociationValid(final ObjectAdapter inObject, final ObjectAdapter associate) {
                return null;
            }

            @Override
            public void setAssociation(final ObjectAdapter inObject, final ObjectAdapter associate) {
            }

            @Override
            public void set(final ObjectAdapter owner, final ObjectAdapter newValue) {
            }

            @Override
            public ObjectAdapter get(final ObjectAdapter target) {
                return null;
            }

            @Override
            public ObjectSpecification getSpecification() {
                return null;
            }

            @Override
            public String debugData() {
                return null;
            }

            @Override
            public String getId() {
                return null;
            }

            @Override
            public String getName() {
                return null;
            }

            @Override
            public FeatureType getFeatureType() {
                return FeatureType.PROPERTY;
            }

        });
        spec.setupFields(fields);

        fieldsObject = new TestProxyAdapter();
        fieldsObject.setupResolveState(ResolveState.TRANSIENT);
        fieldsObject.setupSpecification(system.getSpecification(String.class));
View Full Code Here

        server.setEncoder(mockObjectEncoder);
        server.init();

        object = system.createPersistentTestObject();

        final TestProxySpecification spec = (TestProxySpecification) object.getSpecification();
        nameField = new TestProxyAssociation("name", system.getSpecification(String.class));
        spec.setupFields(Arrays.asList((ObjectAssociation) nameField));

        movieData = new DummyReferenceData(object.getOid(), "none", new TestProxyVersion(1));

    }
View Full Code Here

        assertEquals(0, updatesData.length);
    }

    @Test
    public void testSetValue() {
        final TestProxySpecification specf = system.getSpecification(String.class);
        specf.addFacet(new EncodableFacet() {
            @Override
            public String toEncodedString(final ObjectAdapter object) {
                return null;
            }
View Full Code Here

        super.setUp();
        final FieldOrderCache fieldOrderCache = null; // TODO: should provide a
                                                      // mock here?
        deserializer = new ObjectDeserializer(fieldOrderCache);

        final TestProxySpecification specification = system.getSpecification(Vector.class);
        specification.addFacet(new CollectionFacetAbstract(specification) {

            @Override
            public void init(final ObjectAdapter collection, final ObjectAdapter[] initData) {
                for (final ObjectAdapter element : initData) {
                    collectionOfUnderlying(collection).add(element.getObject());
View Full Code Here

        movieAdapter = system.createPersistentTestObject();
        final Oid movieOid = movieAdapter.getOid();

        movieData = new DummyReferenceData(movieOid, "none", movieAdapter.getVersion());

        final TestProxySpecification spec = (TestProxySpecification) movieAdapter.getSpecification();
        nameField = new TestProxyAssociation("director", system.getSpecification(String.class));
        spec.setupFields(Arrays.asList((ObjectAssociation) nameField));

        personAdapter = system.createPersistentTestObject();
        final Oid personOid = personAdapter.getOid();

        personData = new DummyReferenceData(personOid, "none", personAdapter.getVersion());
View Full Code Here

    public void setUp() throws Exception {
        final boolean isTransient = true;
        final long serialNum = Long.parseLong("1", 16);
        oid = isTransient ? SerialOid.createTransient(serialNum) : SerialOid.createPersistent(serialNum);

        spec = new TestProxySpecification(this.getClass());
        spec.fields = Collections.emptyList();

        version = new FileVersion("", System.currentTimeMillis());
        objectData = new ObjectData(spec, oid, version);
        objectDataVector = new ObjectDataVector();
View Full Code Here

public class ObjectDataTest extends TestCase {

    public void testValueField() {
        FileVersion.setClock(new DefaultClock());

        final TestProxySpecification type = new TestProxySpecification("test");
        final ObjectData objectData = new ObjectData(type, SerialOid.createPersistent(13), new FileVersion(""));

        assertEquals(null, objectData.get("name"));
        objectData.set("name", "value");
        assertEquals("value", objectData.get("name"));
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.testspec.TestProxySpecification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.