Browse Source

new test implementation

Ailton Mizuki Sato 9 years ago
parent
commit
13bf3a8465

+ 3 - 4
config.properties

1
 
1
 
2
+domain = http://50.30.37.180:38080/snail/
2
 
3
 
3
-#domain = http://50.30.37.180:38080/snail/
4
+#domain= http://localhost:8080/Servlet/
4
 
5
 
5
-#domain= http://localhost:8080/snail/
6
-
7
-domain= http://localhost:7000/Servlet/
6
+#domain= http://localhost:7000/Servlet/
8
 
7
 
9
 
8
 

+ 5 - 11
src/test/Start.java

23
 
23
 
24
 /**This is the started from tests*/
24
 /**This is the started from tests*/
25
 public class Start {
25
 public class Start {
26
-	
26
+
27
 	private static List<ServletTest> generateList()
27
 	private static List<ServletTest> generateList()
28
 	{
28
 	{
29
 		List<ServletTest> tests = new ArrayList<ServletTest>();
29
 		List<ServletTest> tests = new ArrayList<ServletTest>();
34
 		tests.add(new TestGetCategories());
34
 		tests.add(new TestGetCategories());
35
 		tests.add(new TestSearch());
35
 		tests.add(new TestSearch());
36
 
36
 
37
-
38
 		tests.add(new TestCreateCategory());
37
 		tests.add(new TestCreateCategory());
39
 		tests.add(new TestSetCategory());
38
 		tests.add(new TestSetCategory());
40
 		tests.add(new TestDeleteCategory());
39
 		tests.add(new TestDeleteCategory());
41
 		tests.add(new TestDeleteItem());
40
 		tests.add(new TestDeleteItem());
41
+		tests.add(new TestCreateItem());
42
 		tests.add(new TestUpdateCategory());
42
 		tests.add(new TestUpdateCategory());
43
 		tests.add(new TestUpdateItem());
43
 		tests.add(new TestUpdateItem());
44
 
44
 
46
 		tests.add(new TestCreateUser());
46
 		tests.add(new TestCreateUser());
47
 		tests.add(new TestLogin());
47
 		tests.add(new TestLogin());
48
 		tests.add(new TestUpdateUser());
48
 		tests.add(new TestUpdateUser());
49
-		tests.add(new TestCreateItem());
49
+	
50
 
50
 
51
 
51
 
52
 		return tests;
52
 		return tests;
53
 	}
53
 	}
54
 
54
 
55
 
55
 
56
+
56
 	public static void main (String [] args){
57
 	public static void main (String [] args){
57
 
58
 
58
-		
59
-		
60
 		List<ServletTest> tests = generateList();
59
 		List<ServletTest> tests = generateList();
61
 
60
 
62
 		for(ServletTest test : tests)
61
 		for(ServletTest test : tests)
68
 		{
67
 		{
69
 			System.out.println(test);
68
 			System.out.println(test);
70
 		}
69
 		}
71
-		
72
-		
70
+
73
 		for(ServletTest test:tests)
71
 		for(ServletTest test:tests)
74
 		{
72
 		{
75
 			System.out.println(test.getUrl());
73
 			System.out.println(test.getUrl());
76
 		}
74
 		}
77
 
75
 
78
 
76
 
79
-
80
-
81
 	}
77
 	}
82
 
78
 
83
 
79
 
84
-
85
-
86
 }
80
 }

+ 2 - 4
src/test/servlet/event/get/TestImportDataFacebook.java

4
 
4
 
5
 public class TestImportDataFacebook extends ServletTestGet{
5
 public class TestImportDataFacebook extends ServletTestGet{
6
 
6
 
7
-
8
-
7
+	
9
 	@Override
8
 	@Override
10
 	public String buildUrl() {
9
 	public String buildUrl() {
11
-	
12
 		
10
 		
13
 		return "data?method=import_data&"
11
 		return "data?method=import_data&"
14
-				+ "token=CAACEdEose0cBAIaFqPHYmsZAQHJnWwCZBJtXAODpUlRKJhvfM5nnRHnZCpdeYvKz2UIvGldXOZAXP3a70mImv69TmlGPOLuxQrUKNNUaf0G8pb2wiNfR6kYCh0SIPZBDV1UJFMIuejoZCvmNbB1LkmviEIArFALrDE9nER1MZAazKYSAgT2ExYmEZAesuTG2lZAagss1HmJiLht8U2Khnzg70"
12
+				+ "token=CAACEdEose0cBAFYW8HLIlYhwmZCsvm9A6X7q8NzsCUN8ov8P6wKtNe1ya8U89OyZA8y6CUWhNHaWlzAqlWOR92J7Ojstaxi4jgt9C8LAcOu3qLeikyBBzwFAjiYjC5jnIZCro0MNR8N6WrCFtqLCsD7PcSWAw3UrkHXUmNmh2rvd9AgQ1OiwuZAVcjkz2SRhtqEuPLFZBfgZDZD"
15
 				+ "&type=Facebook&quantity=14&user_id=1";
13
 				+ "&type=Facebook&quantity=14&user_id=1";
16
 	}
14
 	}
17
 	
15
 	

+ 7 - 1
src/test/servlet/event/post/TestDeleteItem.java

10
 
10
 
11
 	@Override
11
 	@Override
12
 	public Map<String, String> buildParameters() {
12
 	public Map<String, String> buildParameters() {
13
+		
14
+		TestCreateItem item = new  TestCreateItem();
15
+		item.runTest();
16
+		String id = new Integer(item.getId()).toString();
17
+		
13
 		Map<String, String> map = new HashMap<String, String>();
18
 		Map<String, String> map = new HashMap<String, String>();
14
-		map.put("item_id", "120");
19
+		map.put("item_id", id);
20
+		
15
 		
21
 		
16
 		return map;
22
 		return map;
17
 	}
23
 	}