@Override protected void setUp() throws Exception { super.setUp(); facetFactory = new MandatoryFromJdoColumnAnnotationFacetFactory(); cls = SimpleObjectWithColumnAllowsNullAnnotations.class; }
public void testReferenceWithNoAllowsNull_isOptional() throws Exception { final Method method = cls.getMethod("getReferenceWithNoAllowsNull"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
public void testFeatureTypes() { final List<FeatureType> featureTypes = facetFactory.getFeatureTypes(); assertFalse(contains(featureTypes, FeatureType.OBJECT)); assertTrue(contains(featureTypes, FeatureType.PROPERTY)); assertFalse(contains(featureTypes, FeatureType.COLLECTION)); assertFalse(contains(featureTypes, FeatureType.ACTION)); assertFalse(contains(featureTypes, FeatureType.ACTION_PARAMETER_SCALAR)); }
public void testReferenceWithAllowsNullTrue() throws Exception { final Method method = cls.getMethod("getReferenceWithAllowsNullTrue"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
public void testFeatureTypes() { final List<FeatureType> featureTypes = facetFactory.getFeatureTypes(); assertFalse(contains(featureTypes, FeatureType.OBJECT)); assertTrue(contains(featureTypes, FeatureType.PROPERTY)); assertFalse(contains(featureTypes, FeatureType.COLLECTION)); assertFalse(contains(featureTypes, FeatureType.ACTION)); assertFalse(contains(featureTypes, FeatureType.ACTION_PARAMETER_SCALAR)); }
public void testReferenceWithAllowsNullTrue() throws Exception { final Method method = cls.getMethod("getReferenceWithAllowsNullTrue"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
@Override protected void setUp() throws Exception { super.setUp(); facetFactory = new MandatoryFromJdoColumnAnnotationFacetFactory(); cls = SimpleObjectWithColumnAllowsNullAnnotations.class; }
public void testFeatureTypes() { final List<FeatureType> featureTypes = facetFactory.getFeatureTypes(); assertFalse(contains(featureTypes, FeatureType.OBJECT)); assertTrue(contains(featureTypes, FeatureType.PROPERTY)); assertFalse(contains(featureTypes, FeatureType.COLLECTION)); assertFalse(contains(featureTypes, FeatureType.ACTION)); assertFalse(contains(featureTypes, FeatureType.ACTION_PARAMETER)); }
public void testReferenceWithNoAnnotation_isOptional() throws Exception { final Method method = cls.getMethod("getReferenceWithNoAnnotation"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetInferredFromAbsenceOfJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
@Override protected void setUp() throws Exception { super.setUp(); facetFactory = new MandatoryFromJdoColumnAnnotationFacetFactory(); cls = SimpleObjectWithColumnAllowsNullAnnotations.class; }
public void testFeatureTypes() { final List<FeatureType> featureTypes = facetFactory.getFeatureTypes(); assertFalse(contains(featureTypes, FeatureType.OBJECT)); assertTrue(contains(featureTypes, FeatureType.PROPERTY)); assertFalse(contains(featureTypes, FeatureType.COLLECTION)); assertFalse(contains(featureTypes, FeatureType.ACTION)); assertFalse(contains(featureTypes, FeatureType.ACTION_PARAMETER)); }
public void testPrimitiveWithNoAllowsNull_isMandatory() throws Exception { final Method method = cls.getMethod("getPrimitiveWithNoAllowsNull"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(false)); }
@Override protected void setUp() throws Exception { super.setUp(); facetFactory = new MandatoryFromJdoColumnAnnotationFacetFactory(); cls = SimpleObjectWithColumnAllowsNullAnnotations.class; }
public void testPrimitiveWithAllowsNullTrue() throws Exception { final Method method = cls.getMethod("getPrimitiveWithAllowsNullTrue"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
@Override public void refineProgrammingModel(ProgrammingModel programmingModel, IsisConfiguration configuration) { programmingModel.addFactory( new JdoPersistenceCapableAnnotationFacetFactory(), ProgrammingModel.Position.BEGINNING); programmingModel.addFactory(new JdoDatastoreIdentityAnnotationFacetFactory()); programmingModel.addFactory(new JdoPrimaryKeyAnnotationFacetFactory()); programmingModel.addFactory(new JdoNotPersistentAnnotationFacetFactory()); programmingModel.addFactory(new JdoDiscriminatorAnnotationFacetFactory()); programmingModel.addFactory(new JdoVersionAnnotationFacetFactory()); programmingModel.addFactory(new JdoQueryAnnotationFacetFactory()); programmingModel.addFactory(new BigDecimalDerivedFromJdoColumnAnnotationFacetFactory()); programmingModel.addFactory(new MaxLengthDerivedFromJdoColumnAnnotationFacetFactory()); // must appear after JdoPrimaryKeyAnnotationFacetFactory (above) // and also MandatoryFacetOnPropertyMandatoryAnnotationFactory // and also PropertyAnnotationFactory programmingModel.addFactory(new MandatoryFromJdoColumnAnnotationFacetFactory()); programmingModel.addFactory(new AuditableAnnotationInJdoApplibFacetFactory()); programmingModel.addFactory(new AuditableMarkerInterfaceInJdoApplibFacetFactory()); }
public void testPrimitiveWithNoAllowsNull_isMandatory() throws Exception { final Method method = cls.getMethod("getPrimitiveWithNoAllowsNull"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(false)); }
public void testReferenceWithAllowsNullFalse() throws Exception { final Method method = cls.getMethod("getReferenceWithAllowsNullFalse"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(false)); }
public void testPrimitiveWithNoAllowsNull_isMandatory() throws Exception { final Method method = cls.getMethod("getPrimitiveWithNoAllowsNull"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(false)); }
public void testReferenceWithAllowsNullTrue() throws Exception { final Method method = cls.getMethod("getReferenceWithAllowsNullTrue"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(true)); }
public void testPrimitiveWithAllowsNullFalse() throws Exception { final Method method = cls.getMethod("getPrimitiveWithAllowsNullFalse"); facetFactory.process(new FacetFactory.ProcessMethodContext(cls, null, null, method, methodRemover, facetedMethod)); final MandatoryFacet facet = facetedMethod.getFacet(MandatoryFacet.class); assertNotNull(facet); assertTrue(facet instanceof MandatoryFacetDerivedFromJdoColumn); assertThat(facet.isInvertedSemantics(), is(false)); }