????????????@Database??


import static org.junit.Assert.assertEquals;

import org.databene.benerator.anno.Database;
import org.databene.benerator.anno.Source;
import org.databene.feed4junit.Feeder;
import org.junit.Test;
import org.junit.runner.RunWith;

import sample.code.UserAccess;

/*
* Feed4JUnit - Get Data from Database?? all test methods can use the database data
*/
@RunWith(Feeder.class)
@Database(
                id = "testdb"??
                url = "jdbc:mysql://localhost:5000/SAMPLE"??
                driver = "com.mysql.jdbc.Driver"??
                user = "admin"??
                password = "admin")
public class F4JfromDB {

        @Test
        @Source(id = "testdb"?? selector = "select * from TEST")
        public void testAccessCheck(String userName?? String pw?? String expected) {
                Boolean bSucess = UserAccess.accessCheck(userName.trim()?? pw.trim());
                assertEquals(expected.trim()?? bSucess.toString());

        }
}


?????????????????@Database


@RunWith(Feeder.class)
public class F4JfromDB_Method {
        @Test
        @Database(
                        id = "testdb"??
                        url = "jdbc:mysql://localhost:5000/SAMPLE"??

                        driver = "com.mysql.jdbc.Driver"??

                        user = "admin"??
                        password = "admin")
        @Source(id = "testdb"?? selector = "select * from TEST")
        public void testAccessCheck(String userName?? String pw?? String expected) {
                Boolean bSucess = UserAccess.accessCheck(userName.trim()?? pw.trim());
                assertEquals(expected.trim()?? bSucess.toString());

        }
}


???????????й????У???? url??driver ????????????????????? selector ????????????????????????????????????????????????????????????????????е????????????????.

????4????

????Feed4JUnit ?????????????????????????????????????Feed4JUnit ?????????????????????????????????????????????JUnit ?????????????????????????????????

????Feed4JUnit ???????????????????????????????????????????????????????