⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 profiletest.java

📁 jxta_src_2.41b jxta 2.41b 最新版源码 from www.jxta.org
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testProfileSuper() {        File h = new File(HOME, getClass().getName() + ".testProfileSuper");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            Profile.SUPER) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testProfileDefault() {        File h = new File(HOME, getClass().getName() + ".testProfileDefault");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            Profile.DEFAULT) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testAdhocPrivate() {        File h = new File(HOME, getClass().getName() + ".testAdhocPrivate");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_ADHOC_PRIVATE))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));        assertTrue(exists(new File(h, Env.CONFIG_PROPERTIES)));    }        public void testEdgeNatAnyAll() {        File h = new File(HOME, getClass().getName() + ".testEdgeNatAnyAll");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NAT_ANYALL))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testEdgeNat() {        File h = new File(HOME, getClass().getName() + ".testEdgeNat");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NAT))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testEdgeNoRelayNat() {        File h = new File(HOME, getClass().getName() + ".testEdgeNoRelayNat");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NO_RELAY_NAT))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testEdgeNoRelayPrivate() {        File h = new File(HOME, getClass().getName() + ".testEdgeNoRelayPrivate");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NO_RELAY_PRIVATE))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));        assertTrue(exists(new File(h, Env.CONFIG_PROPERTIES)));    }        public void testEdgeNoRelay() {        File h = new File(HOME, getClass().getName() + ".testEdgeNoRelay");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NO_RELAY))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testEdgePrivate() {        File h = new File(HOME, getClass().getName() + ".testEdgePrivate");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_PRIVATE))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));        assertTrue(exists(new File(h, Env.CONFIG_PROPERTIES)));    }        public void testLocalPrivate() {        File h = new File(HOME, getClass().getName() + ".testLocalPrivate");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_LOCAL_PRIVATE))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));        assertTrue(exists(new File(h, Env.CONFIG_PROPERTIES)));    }        public void testSuperNat() {        File h = new File(HOME, getClass().getName() + ".testSuperNat");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_SUPER_NAT))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testSuperPrivate() {        File h = new File(HOME, getClass().getName() + ".testSuperPrivate");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_SUPER_PRIVATE))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));        assertTrue(exists(new File(h, Env.CONFIG_PROPERTIES)));    }        public void testEdgeMulticast() {        File h = new File(HOME, getClass().getName() + ".testEdgeMulticast");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_MULTICAST))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }    public void testEdgeNoMulticast() {        File h = new File(HOME, getClass().getName() + ".testEdgeNoMulticast");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_NO_MULTICAST))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }    public void testEdgeMulticastDisabled() {        File h = new File(HOME, getClass().getName() + ".testEdgeMulticastDisabled");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_MULTICAST_DISABLED))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }    public void testEdgeMulticastUnspecifiedAddress() {        File h = new File(HOME, getClass().getName() + ".testEdgeMulticastUnspecifiedAddress");        AbstractConfigurator ac = new AbstractConfigurator(h.toURI(),            new Profile(getClass().getResource(PROFILE_EDGE_MULTICAST_UNSPECIFIED_ADDRESS))) {            public PlatformConfig createPlatformConfig(Configurator c)            throws ConfiguratorException {                return c.getPlatformConfig();            }        };                try {            ac.save();        } catch (ConfiguratorException ce) {            fail("AbstractConfigurator.save() exception: " + ce.getMessage());        }        assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testDefaultSave() {        File h = new File(HOME, getClass().getName() + ".testDefaultSave");                h.mkdirs();                try {            new Configurator().save(h);        } catch (ConfiguratorException ce) {            fail("Configurator.save() exception: " + ce.getMessage());        }                assertTrue(exists(new File(h, Env.PLATFORM_CONFIG)));    }        public void testWhiteSpaceSave() {        File f = new File(HOME, getClass().getName() + ".testWhiteSpace" +            File.separator + Env.PLATFORM_CONFIG + ".test");                try {            new Configurator().save(f);        } catch (ConfiguratorException ce) {            fail("Configurator.save() exception: " + ce.getMessage());        }                assertTrue(exists(f));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -