Search in sources :

Example 56 with PropertyTree

use of com.enonic.xp.data.PropertyTree in project xp by enonic.

the class ScriptValueTranslatorTest method arrayTest.

@Test
public void arrayTest() throws Exception {
    final PropertyTree properties = getPropertyTree("array");
    assertNotNull(properties.getLong("myArray"));
    assertNotNull(properties.getLong("myArray", 1));
    assertNotNull(properties.getLong("myArray", 2));
    validateType(properties, "myArray", ValueTypes.LONG);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Example 57 with PropertyTree

use of com.enonic.xp.data.PropertyTree in project xp by enonic.

the class ScriptValueTranslatorTest method reference.

@Test
public void reference() throws Exception {
    final PropertyTree properties = getPropertyTree("reference");
    assertNotNull(properties.getReference("myReference"));
    validateType(properties, "myReference", ValueTypes.REFERENCE);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Example 58 with PropertyTree

use of com.enonic.xp.data.PropertyTree in project xp by enonic.

the class ScriptValueTranslatorTest method instant.

@Test
public void instant() throws Exception {
    final PropertyTree properties = getPropertyTree("instant");
    assertNotNull(properties.getInstant("myInstant"));
    validateType(properties, "myInstant", ValueTypes.DATE_TIME);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Example 59 with PropertyTree

use of com.enonic.xp.data.PropertyTree in project xp by enonic.

the class ScriptValueTranslatorTest method booleanTest.

@Test
public void booleanTest() throws Exception {
    final PropertyTree properties = getPropertyTree("boolean");
    assertNotNull(properties.getBoolean("myBoolean"));
    validateType(properties, "myBoolean", ValueTypes.BOOLEAN);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Example 60 with PropertyTree

use of com.enonic.xp.data.PropertyTree in project xp by enonic.

the class ScriptValueTranslatorTest method localDateTime.

@Test
public void localDateTime() throws Exception {
    final PropertyTree properties = getPropertyTree("localDateTime");
    assertNotNull(properties.getLocalDateTime("myLocalDateTime"));
    validateType(properties, "myLocalDateTime", ValueTypes.LOCAL_DATE_TIME);
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Test(org.junit.jupiter.api.Test)

Aggregations

PropertyTree (com.enonic.xp.data.PropertyTree)660 Test (org.junit.jupiter.api.Test)405 PropertySet (com.enonic.xp.data.PropertySet)150 Content (com.enonic.xp.content.Content)126 Node (com.enonic.xp.node.Node)112 CreateContentParams (com.enonic.xp.content.CreateContentParams)64 Form (com.enonic.xp.form.Form)37 Page (com.enonic.xp.page.Page)32 AbstractNodeTest (com.enonic.xp.repo.impl.node.AbstractNodeTest)31 DescriptorKey (com.enonic.xp.page.DescriptorKey)30 GetContentTypeParams (com.enonic.xp.schema.content.GetContentTypeParams)30 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)28 PrincipalKey (com.enonic.xp.security.PrincipalKey)28 BinaryReference (com.enonic.xp.util.BinaryReference)28 Property (com.enonic.xp.data.Property)26 UpdateContentParams (com.enonic.xp.content.UpdateContentParams)24 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)23 ByteSource (com.google.common.io.ByteSource)22 ExtraData (com.enonic.xp.content.ExtraData)21 Instant (java.time.Instant)21