[jbosstools-commits] JBoss Tools SVN: r35276 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Oct 3 06:04:51 EDT 2011


Author: adietish
Date: 2011-10-03 06:04:49 -0400 (Mon, 03 Oct 2011)
New Revision: 35276

Removed:
   trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java
Log:
[JBIDE-9805] moved StringPreferenceValue etc. to org.jboss.tools.common.ui

Deleted: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java	2011-10-03 10:02:14 UTC (rev 35275)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java	2011-10-03 10:04:49 UTC (rev 35276)
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.test.ui.preferences;
-
-import static org.junit.Assert.assertEquals;
-
-import org.jboss.tools.deltacloud.ui.preferences.StringsPreferenceValue;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author André Dietisheim
- */
-public class StringsPreferenceValueTest {
-
-	private static final char DELIMITER = ',';
-
-	private static class StringsPreferenceValueFake extends StringsPreferenceValue {
-
-		private String values = "";
-
-		public StringsPreferenceValueFake(char delimiter) {
-			super(delimiter, null, null);
-		}
-
-
-		@Override
-		protected void doStore(String value) {
-			this.values = value;
-		}
-
-		@Override
-		protected String doGet(String currentValue) {
-			if (currentValue == null || currentValue.equals("")) {
-				return values;
-			} else {
-				return currentValue;
-			}
-		}
-
-	}
-
-	private StringsPreferenceValue stringValues;
-
-	@Before
-	public void setUp() {
-		this.stringValues = new StringsPreferenceValueFake(DELIMITER);
-	}
-
-	@Test
-	public void canAddValues() {
-		stringValues.add("11");
-		stringValues.add("22");
-		assertEquals(2, stringValues.get().length);
-		stringValues.add("33");
-		assertEquals(3, stringValues.get().length);
-	}
-
-	@Test
-	public void identicalValueAreNotAdded() {
-		String value = "11";
-		stringValues.add(value);
-		stringValues.add(value);
-		assertEquals(1, stringValues.get().length);
-	}
-
-	@Test
-	public void canAddDelimiterValue() {
-		stringValues.add("11");
-		assertEquals(1, stringValues.get().length);
-		stringValues.add(DELIMITER + "");
-		assertEquals(2, stringValues.get().length);
-	}
-
-	@Test
-	public void delimiterValueIsReturnedCorrectly() {
-		stringValues.add("11");
-		assertEquals(1, stringValues.get().length);
-		String delimiterValue = DELIMITER + "";
-		stringValues.add(delimiterValue);
-		String[] values = stringValues.get();
-		assertEquals(2, values.length);
-		values[1] = delimiterValue;
-	}
-
-}



More information about the jbosstools-commits mailing list