/* * myLib - https://github.com/taktod/myLib * Copyright (c) 2014 ttProject. All rights reserved. * * Licensed under The MIT license. */ package com.ttProject.container.mp3.test; import org.apache.log4j.Logger; import org.junit.Test; import com.ttProject.container.IContainer; import com.ttProject.container.IReader; import com.ttProject.container.mp3.Mp3UnitReader; import com.ttProject.nio.channels.FileReadChannel; import com.ttProject.nio.channels.IFileReadChannel; /** * mp3unit load test. * @author taktod */ public class Mp3Test { /** logger */ private Logger logger = Logger.getLogger(Mp3Test.class); @Test public void analyzeTest() { IFileReadChannel source = null; try { source = FileReadChannel.openFileReadChannel( Thread.currentThread().getContextClassLoader().getResource("test.mp3.mp3") ); IReader reader = new Mp3UnitReader(); IContainer container = null; while((container = reader.read(source)) != null) { logger.info(container); } } catch(Exception e) { logger.warn(e); } finally { if(source != null) { try { source.close(); } catch(Exception e) { } source = null; } } } }