Commit d9b52776 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

test compilation of generic builders

parent 31a9932e
......@@ -51,7 +51,7 @@ public class DataScriptExpressionRefactoringActionTest {
@Before
public void setUp() throws Exception {
final List<DataRefactorPair> pairsToRefactor = new ArrayList<DataRefactorPair>();
oldData = DataBuilder.create().withName("myData").build();
oldData = DataBuilder.createDataBuilder().withName("myData").build();
pairsToRefactor.add(new DataRefactorPair(oldData, oldData));
refactoringAction = new DataScriptExpressionRefactoringAction(pairsToRefactor,
Collections.<Expression> emptyList(),
......@@ -69,7 +69,7 @@ public class DataScriptExpressionRefactoringActionTest {
@Test
public void should_retrieve_data_in_expression_dependencies() throws Exception {
final Data createData = DataBuilder.create().withName("myData").build();
final Data createData = DataBuilder.createDataBuilder().withName("myData").build();
final Expression expr = ExpressionBuilder.create().
havingReferencedElements(createData,
ParameterBuilder.create().withName("myData").build()).build();
......
......@@ -54,7 +54,7 @@ public class ReadOnlyCheckboxLabelProviderTest extends AbstractSWTTestCase {
@Test
public void shouldIsSelected_ReturnTrue() throws Exception {
final Data data = DataBuilder.create().havingDataType(BooleanDataTypeBuilder.create()).build();
final Data data = DataBuilder.createDataBuilder().havingDataType(BooleanDataTypeBuilder.create()).build();
final WidgetMapping mapping = new WidgetMapping(data);
mapping.setReadOnly(true);
assertThat(readOnlyCheckboxLabelProvider.isSelected(mapping)).isTrue();
......@@ -62,7 +62,7 @@ public class ReadOnlyCheckboxLabelProviderTest extends AbstractSWTTestCase {
@Test
public void shouldIsSelected_ReturnFalse() throws Exception {
final Data data = DataBuilder.create().havingDataType(BooleanDataTypeBuilder.create()).build();
final Data data = DataBuilder.createDataBuilder().havingDataType(BooleanDataTypeBuilder.create()).build();
final WidgetMapping mapping = new WidgetMapping(data);
mapping.setReadOnly(false);
assertThat(readOnlyCheckboxLabelProvider.isSelected(mapping)).isFalse();
......
......@@ -28,8 +28,8 @@ import org.bonitasoft.studio.model.process.ProcessFactory;
*/
public class ActivityBuilder<T extends Activity, B extends ActivityBuilder<T, B>> extends FlowElementBuilder<T, B> {
public static ActivityBuilder<?, ?> create() {
return new ActivityBuilder();
public static <B extends ActivityBuilder<Activity, B>> ActivityBuilder<Activity, B> createActivityBuilder() {
return new ActivityBuilder<Activity, B>();
}
public B withDuration(final String duration) {
......
......@@ -25,8 +25,7 @@ import org.bonitasoft.studio.model.process.ProcessFactory;
*/
public class BusinessObjectDataBuilder extends JavaObjectDataBuilder<BusinessObjectData, BusinessObjectDataBuilder> {
@SuppressWarnings("unchecked")
public static BusinessObjectDataBuilder create() {
public static BusinessObjectDataBuilder createBusinessObjectDataBuilder() {
return new BusinessObjectDataBuilder();
}
......
......@@ -26,7 +26,7 @@ import org.bonitasoft.studio.model.process.ProcessFactory;
*/
public class DataBuilder<T extends Data, B extends DataBuilder<T, B>> extends ElementBuilder<T, B> {
public static <B extends DataBuilder<Data, B>> DataBuilder<Data, B> create() {
public static <B extends DataBuilder<Data, B>> DataBuilder<Data, B> createDataBuilder() {
return new DataBuilder<Data, B>();
}
......
......@@ -25,8 +25,8 @@ import org.bonitasoft.studio.model.process.ProcessFactory;
*/
public class JavaObjectDataBuilder<T extends JavaObjectData, B extends JavaObjectDataBuilder<T, B>> extends DataBuilder<T, B> {
public static JavaObjectDataBuilder<?, ?> create() {
return new JavaObjectDataBuilder();
public static <B extends JavaObjectDataBuilder<JavaObjectData, B>> JavaObjectDataBuilder<JavaObjectData, B> createJavaObjectDataBuilder() {
return new JavaObjectDataBuilder<JavaObjectData, B>();
}
public B withClassname(final String classname) {
......
......@@ -26,8 +26,7 @@ import org.bonitasoft.studio.model.process.Task;
*/
public class TaskBuilder extends ActivityBuilder<Task, TaskBuilder> {
@SuppressWarnings("unchecked")
public static TaskBuilder create() {
public static TaskBuilder createTaskBuilder() {
return new TaskBuilder();
}
......
......@@ -25,8 +25,7 @@ import org.bonitasoft.studio.model.process.XMLData;
*/
public class XMLDataBuilder extends DataBuilder<XMLData, XMLDataBuilder> {
@SuppressWarnings("unchecked")
public static XMLDataBuilder create() {
public static XMLDataBuilder createXMLDataBuilder() {
return new XMLDataBuilder();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment