Procházet zdrojové kódy

Adapted the SCTUnit Testmodels to the changed SCTUnit Syntax

jthoene před 8 roky
rodič
revize
58503003d0

+ 21 - 21
test-plugins/org.yakindu.sct.test.models/tests/AlwaysOncycle.sctunit

@@ -1,22 +1,22 @@
-package tests
-testclass AlwaysOncycle for statechart AlwaysOncycle {
-
-	 operation alwaysOncycleTest (){
-	 	
-	 	enter
-		assert active (AlwaysOncycle.main_region.StateA)
-		while [value < 5] {
-			cycle
-			assert active (AlwaysOncycle.main_region.StateA)
-		}
-		cycle
-		assert active ( AlwaysOncycle.main_region.StateB)
-		while [value < 5] {
-			cycle
-			assert active (AlwaysOncycle.main_region.StateB)
-		}
-		cycle
-		assert active (AlwaysOncycle.main_region.StateA)  
-	}
-		
+package tests
+testclass AlwaysOncycle for statechart AlwaysOncycle {
+
+	 operation alwaysOncycleTest (){
+	 	
+	 	enter
+		assert active (AlwaysOncycle.main_region.StateA)
+		while (value < 5) {
+			cycle
+			assert active (AlwaysOncycle.main_region.StateA)
+		}
+		cycle
+		assert active ( AlwaysOncycle.main_region.StateB)
+		while (value < 5) {
+			cycle
+			assert active (AlwaysOncycle.main_region.StateB)
+		}
+		cycle
+		assert active (AlwaysOncycle.main_region.StateA)  
+	}
+		
 }

+ 11 - 11
test-plugins/org.yakindu.sct.test.models/tests/LogicalAnd.sctunit

@@ -1,12 +1,12 @@
-package tests
-testclass LogicalAndTests for statechart LogicalAnd {
-	
-	operation operandEvaluationOrder(){
-		
-		enter
-		cycle
-		
-		assert x == 4 && b "logical and expression was executed in wrong order..."	
-	}
-
+package tests
+testclass LogicalAndTests for statechart LogicalAnd {
+	
+	operation operandEvaluationOrder(){
+		
+		enter
+		cycle
+		
+		assert x == 4 && b message "logical and expression was executed in wrong order..."	
+	}
+
 }

+ 11 - 11
test-plugins/org.yakindu.sct.test.models/tests/LogicalOr.sctunit

@@ -1,12 +1,12 @@
-package tests
-testclass LogicalOrTests for statechart LogicalOr {
-	
-	operation operandEvaluationOrder(){
-		
-		enter
-		cycle
-		
-		assert x == 4 && b "logical or expression was executed in wrong order..."	
-	}
-
+package tests
+testclass LogicalOrTests for statechart LogicalOr {
+	
+	operation operandEvaluationOrder(){
+		
+		enter
+		cycle
+		
+		assert x == 4 && b message "logical or expression was executed in wrong order..."	
+	}
+
 }

+ 70 - 76
test-plugins/org.yakindu.sct.test.models/tests/PerformanceTests.sctunit

@@ -1,77 +1,71 @@
-package tests
-testclass PerformanceTests for statechart PerformanceTest {
-	
-	
-	operation test_100_000(){
-				
-		enter		
-				
-		assert active(PerformanceTest.mr.A) 
-		
-		while [ c < 100000 ] {
-			if [active(PerformanceTest.mr.A)] {			
-				raise e1
-			} else { 
-				if [c % 2 == 0] {
-					raise e2
-				} else {
-					raise e3
-				}
-			}
-	 
-			cycle						
-		}
-		
-		assert a > 2
-	}
-	 
-	 
-	//----------------
-	operation test_1_000_000(){
-			
-		enter	
-				
-		assert active(PerformanceTest.mr.A) 
-		
-		while [ c < 1000000 ] {
-			if [active(PerformanceTest.mr.A)] {			
-				raise e1
-			} else { 
-				if [c % 2 == 0] {
-					raise e2
-				} else {
-					raise e3
-				}
-			}
-	 
-			cycle						
-		}
-		
-		assert a > 2
-	}
-	 
-	operation test_10_000_000(){
-				
-		enter		
-				
-		assert active(PerformanceTest.mr.A) 
-		
-		while [ c < 10000000 ] {
-			if [active(PerformanceTest.mr.A)] {			
-				raise e1
-			} else { 
-				if [c % 2 == 0] {
-					raise e2
-				} else {
-					raise e3
-				}
-			}
-	 
-			cycle						
-		}
-		
-		assert a > 2
-	}
-	 
-}
+package tests
+testclass PerformanceTests for statechart PerformanceTest {
+
+	operation test_100_000 () {
+
+		enter
+
+		assert active (PerformanceTest.mr.A)
+
+		while (c < 100000) {
+			if (active (PerformanceTest.mr.A)) {
+				raise e1
+			} else {
+				if (c % 2 == 0) {
+					raise e2
+				} else {
+					raise e3
+				}
+			}
+
+			cycle
+		}
+
+		assert a > 2
+	} //----------------
+	operation test_1_000_000 () {
+
+		enter
+
+		assert active (PerformanceTest.mr.A)
+
+		while (c < 1000000) {
+			if (active (PerformanceTest.mr.A)) {
+				raise e1
+			} else {
+				if (c % 2 == 0) {
+					raise e2
+				} else {
+					raise e3
+				}
+			}
+
+			cycle
+		}
+
+		assert a > 2
+	} operation test_10_000_000 () {
+
+		enter
+
+		assert active (PerformanceTest.mr.A)
+
+		while (c < 10000000) {
+			if (active (PerformanceTest.mr.A)) {
+				raise e1
+			} else {
+				if (c % 2 == 0) {
+					raise e2
+				} else {
+					raise e3
+				}
+			}
+
+			cycle
+		}
+
+		assert a > 2
+	}
+
+}
 	

+ 17 - 17
test-plugins/org.yakindu.sct.test.models/tests/SimpleEvent.sctunit

@@ -1,18 +1,18 @@
-package tests
-testclass SimpleEvent for statechart SimpleEvent {
-	operation simpleEventTest(){
-		
-		enter
-		
-		assert active (SimpleEvent.main_region.A) "Expected A to be active"
-		assert 5 == 5
-		raise Event1
-		cycle
-		assert active (SimpleEvent.main_region.B) "Expected B to be active"
-		
-		cycle
-		assert !active (SimpleEvent.main_region.B)	
-		      
-	}        
-}
+package tests
+testclass SimpleEvent for statechart SimpleEvent {
+	operation simpleEventTest(){
+		
+		enter
+		
+		assert active (SimpleEvent.main_region.A) message "Expected A to be active"
+		assert 5 == 5
+		raise Event1
+		cycle
+		assert active (SimpleEvent.main_region.B) message "Expected B to be active"
+		
+		cycle
+		assert !active (SimpleEvent.main_region.B)	
+		      
+	}        
+}
                 

+ 18 - 18
test-plugins/org.yakindu.sct.test.models/tests/StatechartLocalReactions.sctunit

@@ -1,19 +1,19 @@
-package tests
-testclass StatechartLocalReactions for statechart StatechartLocalReactions {
-	operation statechartLocalReactionsTest(){
-		
-		enter
-				
-		assert active (StatechartLocalReactions.main_region.S1)
-		assert active (StatechartLocalReactions.region2.a)
-		while [ myInt < 10 ] {
-			assert active (StatechartLocalReactions.region2.a)
-			if[myInt%2 == 0]{
-				assert active (StatechartLocalReactions.main_region.S1)
-			}else {
-				assert active (StatechartLocalReactions.main_region.S2)
-			}
-			cycle 
-		} 
-	}
+package tests
+testclass StatechartLocalReactions for statechart StatechartLocalReactions {
+	operation statechartLocalReactionsTest(){
+		
+		enter
+				
+		assert active (StatechartLocalReactions.main_region.S1)
+		assert active (StatechartLocalReactions.region2.a)
+		while (myInt < 10) {
+			assert active (StatechartLocalReactions.region2.a)
+			if(myInt%2 == 0){
+				assert active (StatechartLocalReactions.main_region.S1)
+			}else {
+				assert active (StatechartLocalReactions.main_region.S2)
+			}
+			cycle 
+		} 
+	}
 }