Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * OfficeFloor - http://www.officefloor.net
   * Copyright (C) 2005-2011 Daniel Sagenschneider
   *
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 package net.officefloor.model.impl.desk;
 
 
 
 public class RefactorWorkTest extends AbstractRefactorWorkTest {

 
 	public void testRenameWork() {
 		this.refactor_workName("NEW_NAME");
 		this.doRefactor();
 	}

 
 	public void testChangeWorkSourceClass() {
 		this.refactor_workSourceClassName("net.another.AnotherWorkSource");
 		this.doRefactor();
 	}

 
 	public void testChangeProperties() {
 		this.refactor_addProperty("ANOTHER_NAME""ANOTHER_VALUE");
 		this.doRefactor();
 	}

 
 	public void testRemoveWorkTask() {
 		this.refactor_mapTask("TASK_B""TASK_B");
 		this.refactor_includeTasks("TASK_B");
 			public void construct(WorkTypeContext context) {
 				context.addTask("TASK_B");
 			}
 		});
 	}

Tests removing a net.officefloor.model.desk.WorkTaskModel with connections.
 
 		this.refactor_mapTask("TASK_B""TASK_B");
 		this.refactor_includeTasks("TASK_B");
 			public void construct(WorkTypeContext context) {
 				context.addTask("TASK_B");
 			}
 		});
 	}

Tests not including the net.officefloor.model.desk.WorkTaskModel.
 
 	public void testNotIncludeWorkTask() {
 		this.refactor_mapTask("TASK_A""TASK_A");
		this.refactor_mapTask("TASK_B""TASK_B");
		this.refactor_includeTasks("TASK_B"); // not include TASK_A
			public void construct(WorkTypeContext context) {
				// Task A
				TaskTypeConstructor taskA = context.addTask("TASK_A");
				taskA.addFlow(Object.classnull).setLabel("FLOW_A");
				taskA.addFlow(Object.classnull).setLabel("FLOW_B");
				taskA.addObject(Object.classnull).setLabel("OBJECT");
				// Task B
				context.addTask("TASK_B");
			}
		});
	}

	public void testRefactorWorkTask() {
		this.refactor_mapTask("TASK_NEW""TASK_OLD");
		this.refactor_includeTasks("TASK_NEW");
			public void construct(WorkTypeContext context) {
				TaskTypeConstructor task = context.addTask("TASK_NEW");
			}
		});
	}

Keys.
	public static enum Key {
		KEY_ONE, KEY_TWO
	}

Tests refactoring the net.officefloor.model.desk.WorkTaskObjectModel instances.
	public void testRefactorWorkTaskObjects() {
		this.refactor_mapTask("TASK""TASK");
		this.refactor_mapObject("TASK""CHANGE_DETAILS""CHANGE_DETAILS");
		this.refactor_mapObject("TASK""RENAME_NEW""RENAME_OLD");
		this.refactor_mapObject("TASK""REORDER_A""REORDER_A");
		this.refactor_mapObject("TASK""REORDER_B""REORDER_B");
			public void construct(WorkTypeContext context) {
				TaskTypeConstructor task = context.addTask("TASK");
						"CHANGE_DETAILS");
				task.addObject(Integer.classnull).setLabel("ADDED");
				task.addObject(String.classnull).setLabel("RENAME_NEW");
				task.addObject(Double.classnull).setLabel("REORDER_B");
				task.addObject(Float.classnull).setLabel("REORDER_A");
			}
		});
	}

Tests refactoring the net.officefloor.model.desk.TaskFlowModel instances.
	public void testRefactorTaskFlows() {
		this.refactor_mapTask("WORK_TASK""WORK_TASK");
		this.refactor_mapFlow("TASK""CHANGE_DETAILS""CHANGE_DETAILS");
		this.refactor_mapFlow("TASK""RENAME_NEW""RENAME_OLD");
		this.refactor_mapFlow("TASK""REORDER_A""REORDER_A");
		this.refactor_mapFlow("TASK""REORDER_B""REORDER_B");
			public void construct(WorkTypeContext context) {
				TaskTypeConstructor task = context.addTask("WORK_TASK");
				task.addFlow(Byte.class.)
						.setLabel("CHANGE_DETAILS");
				task.addFlow(String.classnull).setLabel("ADDED");
				task.addFlow(Integer.classnull).setLabel("RENAME_NEW");
				task.addFlow(Double.classnull).setLabel("REORDER_B");
				task.addFlow(Float.classnull).setLabel("REORDER_A");
			}
		});
	}

Tests refactoring the net.officefloor.model.desk.TaskEscalationModel instances.
	public void testRefactorTaskEscalations() {
		this.refactor_mapTask("WORK_TASK""WORK_TASK");
		this.refactor_mapEscalation("TASK"Error.class.getName(), Error.class
			public void construct(WorkTypeContext context) {
				TaskTypeConstructor task = context.addTask("WORK_TASK");
				task.addEscalation(Error.class);
			}
		});
	}
New to GrepCode? Check out our FAQ X