void () { final JpsModule module = myProject.addModule("m", JpsJavaModuleType.INSTANCE); JavaSourceRootProperties properties = JpsJavaExtensionService.getInstance().createSourceRootProperties("com.xxx"); module.addSourceRoot("file://url", JavaSourceRootType.SOURCE, properties); final JpsModuleSourceRoot root = assertOneElement(module.getSourceRoots()); assertEquals("file://url", root.getUrl()); assertSameElements(ContainerUtil.newArrayList(module.getSourceRoots(JavaSourceRootType.SOURCE)), root); assertEmpty(ContainerUtil.newArrayList(module.getSourceRoots(JavaSourceRootType.TEST_SOURCE))); JpsTypedModuleSourceRoot<JavaSourceRootProperties> typedRoot = root.asTyped(JavaSourceRootType.SOURCE); assertNotNull(typedRoot); assertEquals("com.xxx", typedRoot.getProperties().getPackagePrefix()); }