Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.io.File createConfigFiles() throws java.io.IOException
        public virtual File CreateConfigFiles()
        {
            File temporaryConfigFile = ServerTestUtils.createTempConfigFile();
            File temporaryFolder     = ServerTestUtils.createTempDir();

            ServerTestUtils.writeConfigToFile(CreateConfiguration(temporaryFolder), temporaryConfigFile);

            return(temporaryConfigFile);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFindThirdPartyJaxRsPackages() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFindThirdPartyJaxRsPackages()
        {
            // given
            File file = ServerTestUtils.createTempConfigFile(Folder.Root);

            using (StreamWriter @out = new StreamWriter(new StreamWriter(file, true)))
            {
                @out.BaseStream.WriteByte(ServerSettings.third_party_packages.name());
                @out.Write("=");
                @out.Write("com.foo.bar=\"mount/point/foo\",");
                @out.Write("com.foo.baz=\"/bar\",");
                @out.Write("com.foo.foobarbaz=\"/\"");
                @out.Write(Environment.NewLine);
            }

            // when
            Config config = Config.fromFile(file).withHome(Folder.Root).build();

            // then
            IList <ThirdPartyJaxRsPackage> thirdpartyJaxRsPackages = config.Get(ServerSettings.third_party_packages);

            assertNotNull(thirdpartyJaxRsPackages);
            assertEquals(3, thirdpartyJaxRsPackages.Count);
        }