110 // Export a package, that does not exist, to from_module
111 try {
112 ModuleHelper.AddModuleExports(from_module, "notmypackage", from_module);
113 throw new RuntimeException("Failed to get the expected IAE");
114 } catch(IllegalArgumentException e) {
115 // Expected
116 }
117
118 // Export a package, that is not in from_module, to from_module
119 try {
120 ModuleHelper.AddModuleExports(from_module, "that/apackage", from_module);
121 throw new RuntimeException("Failed to get the expected IAE");
122 } catch(IllegalArgumentException e) {
123 // Expected
124 }
125
126 // Export the same package twice to the same module
127 ModuleHelper.AddModuleExports(from_module, "x/apackage", to_module);
128 ModuleHelper.AddModuleExports(from_module, "x/apackage", to_module);
129
130 // Export a package, using '.' instead of '/'
131 try {
132 ModuleHelper.AddModuleExports(from_module, "x.apackage", to_module);
133 throw new RuntimeException("Failed to get the expected IAE");
134 } catch(IllegalArgumentException e) {
135 // Expected
136 }
137
138 // Export a package to the unnamed module and then to a specific module.
139 // The qualified export should be ignored.
140 ModuleHelper.AddModuleExportsToAll(to_module, "that/apackage");
141 ModuleHelper.AddModuleExports(to_module, "that/apackage", from_module);
142 }
143
144 static class MyClassLoader extends ClassLoader { }
145 }
|
110 // Export a package, that does not exist, to from_module
111 try {
112 ModuleHelper.AddModuleExports(from_module, "notmypackage", from_module);
113 throw new RuntimeException("Failed to get the expected IAE");
114 } catch(IllegalArgumentException e) {
115 // Expected
116 }
117
118 // Export a package, that is not in from_module, to from_module
119 try {
120 ModuleHelper.AddModuleExports(from_module, "that/apackage", from_module);
121 throw new RuntimeException("Failed to get the expected IAE");
122 } catch(IllegalArgumentException e) {
123 // Expected
124 }
125
126 // Export the same package twice to the same module
127 ModuleHelper.AddModuleExports(from_module, "x/apackage", to_module);
128 ModuleHelper.AddModuleExports(from_module, "x/apackage", to_module);
129
130 // Export the same package, using '.' instead of '/'
131 ModuleHelper.AddModuleExports(from_module, "x.apackage", to_module);
132
133 // Export a package to the unnamed module and then to a specific module.
134 // The qualified export should be ignored.
135 ModuleHelper.AddModuleExportsToAll(to_module, "that/apackage");
136 ModuleHelper.AddModuleExports(to_module, "that/apackage", from_module);
137 }
138
139 static class MyClassLoader extends ClassLoader { }
140 }
|