Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.ext.properties.editor.model;
 
 import java.util.List;
 
 import org.junit.Test;
 
 import static org.junit.Assert.*;
 
public class PropertyEditorEventTest {
    @Test
    public void sortCategoryByPriority() {
        List<PropertyEditorCategorycategories = new ArrayList<PropertyEditorCategory>();
        PropertyEditorCategory category1 = new PropertyEditorCategory"cat1", 2 );
        categories.addcategory1 );
        PropertyEditorCategory category2 = new PropertyEditorCategory"catHighPriority", 1 );
        categories.addcategory2 );
        PropertyEditorEvent event = new PropertyEditorEvent"event"categories );
        assertEqualscategory2event.getSortedProperties().get( 0 ) );
        assertEqualscategory1event.getSortedProperties().get( 1 ) );
    }
    @Test
    public void sortFieldsByPriority() {
        PropertyEditorFieldInfo highPriority = new PropertyEditorFieldInfo"highPriority". ).withPriority( 1 );
        PropertyEditorFieldInfo lowPriority = new PropertyEditorFieldInfo"lowPriority". ).withPriority( 10 );
        PropertyEditorCategory category = new PropertyEditorCategory"cat1", 2 )
                .withFieldlowPriority )
                .withFieldhighPriority );
        PropertyEditorEvent event = new PropertyEditorEvent"event"category );
        assertEqualshighPriorityevent.getSortedProperties().get( 0 ).getFields().get( 0 ) );
        assertEqualslowPriorityevent.getSortedProperties().get( 0 ).getFields().get( 1 ) );
    }
New to GrepCode? Check out our FAQ X