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

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


        adapter = system.createPersistentTestObject();
        oid = adapter.getOid();

        targetData = new DummyIdentityData(oid, TestProxyAdapter.class.getName(), new TestProxyVersion(1));
        parameterData = new ReferenceData[] {};
        final TestProxySpecification proxySpecification = (TestProxySpecification) adapter.getSpecification();

        mockAction = mockery.mock(ObjectAction.class);
        proxySpecification.setupAction(mockAction);

        mockery.checking(new Expectations() {
            {
                one(mockAction).getId();
                will(returnValue("action"));
View Full Code Here


    /**
     *
     */
    public TestProxyCollectionAdapter createPersistentTestCollection() {
        final TestProxyCollectionAdapter collection = new TestProxyCollectionAdapter(new Vector());
        final TestProxySpecification specification = getSpecification(Vector.class);
        final TestProxySpecification elementSpecification = getSpecification(Object.class);
        specification.addFacet(new TestProxyCollectionFacet());
        specification.addFacet(new TypeOfFacetDefaultToObject(elementSpecification, reflector) {
        });
        collection.setupSpecification(specification);
        return collection;
View Full Code Here

    }

    @Before
    public void setup() {
        facetedMethod = FacetedMethod.createProperty(Customer.class, "firstName");
        objectAssociation = new ObjectAssociationAbstract(facetedMethod, FeatureType.PROPERTY, new TestProxySpecification("test"), new ObjectMemberContext(null, null, null, null, null)) {

            @Override
            public ObjectAdapter get(final ObjectAdapter fromObject) {
                return null;
            }
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

    protected void setUp() throws Exception {
        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

        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

        adapter = system.createPersistentTestObject();
        oid = adapter.getOid();

        targetData = new DummyIdentityData(oid, TestProxyAdapter.class.getName(), new TestProxyVersion(1));
        parameterData = new ReferenceData[] {};
        final TestProxySpecification proxySpecification = (TestProxySpecification) adapter.getSpecification();

        mockAction = mockery.mock(ObjectAction.class);
        proxySpecification.setupAction(mockAction);

        mockery.checking(new Expectations() {
            {
                one(mockAction).getId();
                will(returnValue("action"));
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

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.