1 19 20 package org.netbeans.spi.looks; 21 22 import java.util.*; 23 24 import org.netbeans.junit.*; 25 26 import org.netbeans.spi.looks.*; 27 28 31 public class DecoratorSelectorValuesTest extends TestBaseValues { 32 33 35 private GoldenValue goldenValues[][]; 36 private static GoldenValue gvForTypes[] = GoldenValue.createGoldenValues(); 37 38 40 public DecoratorSelectorValuesTest(java.lang.String testName) { 41 super(testName); 42 } 43 44 public static void main(java.lang.String [] args) { 45 junit.textui.TestRunner.run(suite()); 46 } 47 48 public static NbTest suite() { 49 NbTestSuite suite = new NbTestSuite( DecoratorSelectorValuesTest.class ); 50 return suite; 51 } 52 53 protected void setUp() throws Exception { 54 55 goldenValues = new GoldenValue[][] { 56 CompositeLookValuesTest.createGoldenValues( 1 ), 57 CompositeLookValuesTest.createGoldenValues( 2 ), 58 CompositeLookValuesTest.createGoldenValues( 3 ) 59 }; 60 61 GoldenValue[] resultValues = CompositeLookValuesTest.mergeGoldenValues( goldenValues ); 62 63 Look look1 = new SampleLook( "CL1", goldenValues[0] ); 64 Look look2 = new SampleLook( "CL2", goldenValues[1] ); 65 Look look3 = new SampleLook( "CL3", goldenValues[2] ); 66 67 Look primaryLook = Looks.composite( "Composite", new Look[] { look1, look2 } ); 69 LookSelector primarySelector = Selectors.selector( new SampleProvider( primaryLook ) ); 70 71 LookSelector decoratingSelector = Selectors.decorator( primarySelector, look3 ); 73 74 SampleRepObject representedObject = new SampleRepObject(); 76 77 Enumeration de = decoratingSelector.getLooks( representedObject ); 79 Look decoratingLook = (Look)de.nextElement(); 80 81 setTarget( decoratingLook, representedObject, 3 ); 82 setGoldenValues( resultValues ); 83 84 super.setUp(); 85 } 86 87 protected void tearDown() throws Exception { 88 super.tearDown(); 89 } 90 91 92 94 100 101 102 } 103 104 105 | Popular Tags |