// Path: BiliLiveLib/src/test/java/charlie/bililivelib/LogUtil.java
// public class LogUtil {
//     private static final String LINE_BREAKING = System.lineSeparator();
// 
//     private static Logger logger;
// 
//     public static void init() {
//         logger = LogManager.getLogger(BiliLiveLib.class);
//     }
// 
//     public static synchronized void logException(Level level, @NotNull @Nls String message, @NotNull Throwable ex) {
//         if (logger == null) return;
//         logger.log(level, message);
//         StringTokenizer tokenizer = getStackTrace(ex);
//         while(tokenizer.hasMoreTokens()) {
//             logger.log(level, tokenizer.nextToken());
//         }
//     }
// 
//     private static StringTokenizer getStackTrace(Throwable ex) {
//         ByteArrayOutputStream temp = new ByteArrayOutputStream();
//         ex.printStackTrace(new PrintStream(temp));
//         String stackTrace = new String(temp.toByteArray());
//         return new StringTokenizer(stackTrace, LINE_BREAKING);
//     }
// 
//     @Contract(pure = true)
//     private static Logger logger() {
//         return logger;
//     }
// }
// 
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/TestSessionHelper.java
// public static Session initSession() throws IOException, BiliLiveException {
//     BasicCookieStore store = new BasicCookieStore();
//     Session session = new Session(HttpClientBuilder.create()
//             .setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36")
//             .setConnectionManager(Globals.get().getConnectionPool())
//             .setSSLContext(Globals.get().getBilibiliSSLContext())
//             .setDefaultCookieStore(store).build(), store);
//     Path cookieFile = Paths.get("cookies.bin");
//     if (Files.exists(cookieFile)) {
//         loadSessionFromFile(session);
//     } else {
//         login(session);
//         Files.createFile(cookieFile);
//     }
// 
//     ObjectOutputStream stream = new ObjectOutputStream(Files.newOutputStream(cookieFile, StandardOpenOption.TRUNCATE_EXISTING));
//     stream.writeObject(store);
//     stream.close();
//     return session;
// }


import charlie.bililivelib.LogUtil;
import org.junit.BeforeClass;
import org.junit.Test;
import static charlie.bililivelib.TestSessionHelper.initSession;
import static org.junit.Assert.fail;
package charlie.bililivelib.freesilver;



public class FreeSilverProtocolTest {
    @BeforeClass
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/LogUtil.java
// public class LogUtil {
//     private static final String LINE_BREAKING = System.lineSeparator();
// 
//     private static Logger logger;
// 
//     public static void init() {
//         logger = LogManager.getLogger(BiliLiveLib.class);
//     }
// 
//     public static synchronized void logException(Level level, @NotNull @Nls String message, @NotNull Throwable ex) {
//         if (logger == null) return;
//         logger.log(level, message);
//         StringTokenizer tokenizer = getStackTrace(ex);
//         while(tokenizer.hasMoreTokens()) {
//             logger.log(level, tokenizer.nextToken());
//         }
//     }
// 
//     private static StringTokenizer getStackTrace(Throwable ex) {
//         ByteArrayOutputStream temp = new ByteArrayOutputStream();
//         ex.printStackTrace(new PrintStream(temp));
//         String stackTrace = new String(temp.toByteArray());
//         return new StringTokenizer(stackTrace, LINE_BREAKING);
//     }
// 
//     @Contract(pure = true)
//     private static Logger logger() {
//         return logger;
//     }
// }
// 
// Path: BiliLiveLib/src/test/java/charlie/bililivelib/TestSessionHelper.java
// public static Session initSession() throws IOException, BiliLiveException {
//     BasicCookieStore store = new BasicCookieStore();
//     Session session = new Session(HttpClientBuilder.create()
//             .setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36")
//             .setConnectionManager(Globals.get().getConnectionPool())
//             .setSSLContext(Globals.get().getBilibiliSSLContext())
//             .setDefaultCookieStore(store).build(), store);
//     Path cookieFile = Paths.get("cookies.bin");
//     if (Files.exists(cookieFile)) {
//         loadSessionFromFile(session);
//     } else {
//         login(session);
//         Files.createFile(cookieFile);
//     }
// 
//     ObjectOutputStream stream = new ObjectOutputStream(Files.newOutputStream(cookieFile, StandardOpenOption.TRUNCATE_EXISTING));
//     stream.writeObject(store);
//     stream.close();
//     return session;
// }


// Path: BiliLiveLib/src/test/java/charlie/bililivelib/freesilver/FreeSilverProtocolTest.java
import charlie.bililivelib.LogUtil;
import org.junit.BeforeClass;
import org.junit.Test;
import static charlie.bililivelib.TestSessionHelper.initSession;
import static org.junit.Assert.fail;

package charlie.bililivelib.freesilver;



public class FreeSilverProtocolTest {
    @BeforeClass
    public static void setUp() throws Exception {