コード例 #1
0
ファイル: VolumeTest.java プロジェクト: 2510/xtreemfs
  @BeforeClass
  public static void initializeTest() throws Exception {
    FSUtils.delTree(new java.io.File(SetupUtils.TEST_DIR));

    Logging.start(SetupUtils.DEBUG_LEVEL, SetupUtils.DEBUG_CATEGORIES);

    dirConfig = SetupUtils.createDIRConfig();
    dir = new DIRRequestDispatcher(dirConfig, SetupUtils.createDIRdbsConfig());
    dir.startup();
    dir.waitForStartup();

    testEnv =
        new TestEnvironment(
            new TestEnvironment.Services[] {
              TestEnvironment.Services.DIR_CLIENT,
              TestEnvironment.Services.TIME_SYNC,
              TestEnvironment.Services.RPC_CLIENT,
              TestEnvironment.Services.MRC
            });
    testEnv.start();

    userCredentials = UserCredentials.newBuilder().setUsername("test").addGroups("test").build();

    dirAddress = testEnv.getDIRAddress().getHostName() + ":" + testEnv.getDIRAddress().getPort();
    mrcAddress = testEnv.getMRCAddress().getHostName() + ":" + testEnv.getMRCAddress().getPort();

    defaultCoordinates =
        VivaldiCoordinates.newBuilder()
            .setXCoordinate(0)
            .setYCoordinate(0)
            .setLocalError(0)
            .build();
    defaultStripingPolicy =
        StripingPolicy.newBuilder()
            .setType(StripingPolicyType.STRIPING_POLICY_RAID0)
            .setStripeSize(128)
            .setWidth(1)
            .build();

    osds = new OSD[4];
    configs = SetupUtils.createMultipleOSDConfigs(4);

    // start three OSDs
    osds[0] = new OSD(configs[0]);
    osds[1] = new OSD(configs[1]);
    osds[2] = new OSD(configs[2]);
    osds[3] = new OSD(configs[3]);

    mrcClient = new MRCServiceClient(testEnv.getRpcClient(), null);

    options = new Options();
    client = ClientFactory.createClient(dirAddress, userCredentials, null, options);
    client.start();
  }
コード例 #2
0
 public UUIDIteratorTest() throws IOException {
   dirConfig = SetupUtils.createDIRConfig();
   Logging.start(SetupUtils.DEBUG_LEVEL, SetupUtils.DEBUG_CATEGORIES);
 }