Browse Source

Fixed some tests

Yentl Van Tendeloo 8 years ago
parent
commit
3591deb87f
4 changed files with 20 additions and 26 deletions
  1. 0 1
      bootstrap/model_management.alc
  2. 19 22
      core/core_algorithm.alc
  3. 0 1
      core/mini_modify.alc
  4. 1 2
      integration/test_mvc.py

+ 0 - 1
bootstrap/model_management.alc

@@ -205,7 +205,6 @@ Element function model_join(models : Element, metamodel : Element, tracability_m
 		tracability_links = allInstances(tracability_model, "TracabilityLink")
 
 		while (read_nr_out(tracability_links) > 0):
-			log("Using tracability link!")
 			tracability_link = set_pop(tracability_links)
 
 			// Get necessary information from the tracability link

+ 19 - 22
core/core_algorithm.alc

@@ -377,37 +377,34 @@ Element function user_function():
 	// Load in a hard-reference to the previously created model
 	core = import_node(core_model_location)
 
-	output("Log on as which user?")
-	username = input()
-
-	user_id = get_user_id(username)
-	if (user_id == ""):
-		// New user
-		// Add user to Core Formalism
-		user_id = instantiate_node(core, "User", "")
-		instantiate_attribute(core, user_id, "name", username)
-		instantiate_attribute(core, user_id, "admin", False)
-
-		while (True):
+	while (True):
+		output("Log on as which user?")
+		username = input()
+
+		user_id = get_user_id(username)
+		if (user_id == ""):
+			// New user
+			// Add user to Core Formalism
+			user_id = instantiate_node(core, "User", "")
+			instantiate_attribute(core, user_id, "name", username)
+			instantiate_attribute(core, user_id, "admin", False)
+
 			output("This is a new user: please give password!")
 			password = hash(input())
 
 			output("Please repeat the password")
 			if (password == hash(input())):
-				output("Passwords match!")
-				output("User created")
 				instantiate_attribute(core, user_id, "password", password)
 				break!
 			else:
-				output("Not the same password, please try again!")
+				output("Not the same password!")
+		else:
+			if (check_login(user_id)):
+				break!
+			else:
+				output("Wrong password!")
 
-		// Now call with user created
-		user_function_skip_init(user_id)
-	else:
-		while (bool_not(check_login(user_id))):
-			output("Wrong password! Try again")
-		
-		user_function_skip_init(user_id)
+	user_function_skip_init(user_id)
 
 	// User destroyed already, so just stop execution
 	// TODO return a fresh node as otherwise the compiler doesn't take this

+ 0 - 1
core/mini_modify.alc

@@ -128,7 +128,6 @@ Element function modify(model : Element, write : Boolean):
 							instantiate_node(model, mm_type_name, element_name)
 							output("Instantiation successful!")
 				else:
-					log("Could not find element in " + set_to_string(dict_keys(model["metamodel"]["model"])))
 					output("Unknown type specified; aborting")
 			else:
 				output("Permission denied")

+ 1 - 2
integration/test_mvc.py

@@ -318,7 +318,6 @@ class TestModelverseCore(unittest.TestCase):
                 "Supported metamodels:",
                 set(["  PetriNets",
                     ]),
-                "",
                 "Which metamodels do you want to use as source for the operation (empty string to finish)?",
                 "Which metamodels do you want to use as target for the operation (empty string to finish)?",
                 "Name of new operation?",
@@ -388,7 +387,6 @@ class TestModelverseCore(unittest.TestCase):
                 "Supported metamodels:",
                 set(["  PetriNets",
                     ]),
-                "",
                 "Which metamodels do you want to use as source for the operation (empty string to finish)?",
                 "Which metamodels do you want to use as target for the operation (empty string to finish)?",
                 "Name of new operation?",
@@ -1619,6 +1617,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Which transformation do you want to execute?",
                 "Which model to bind for source type PetriNets",
                 "Which model to create for target type PetriNets_Runtime",
+                "Please perform manual operation \"pn_design_to_runtime\"",
                 "Model loaded, ready for commands!",
                 "Use 'help' command for a list of possible commands",
                 "Please give your command.",